Overview
Flow workflows are composed of steps. Each step has a type that determines its behavior, a configuration object specific to that type, and connections to downstream steps. The workflow engine executes steps in order, passing data through the shared execution context.
LLM Call
The llm_call step sends a prompt to an AI model and stores the response in the execution context. Prompts support variable interpolation from previous step outputs.
{
"id": "summarize",
"name": "Summarize Document",
"type": "llm_call",
"config": {
"prompt": "Summarize the following government document in 3 bullet points:\n\n{{input.document_text}}",
"model": "llama-3.3-70b-versatile"
},
"next_step": "review",
"timeout_seconds": 30
}
Configuration:
| Field | Type | Description |
|---|---|---|
prompt | string | The prompt template with {{variable}} placeholders |
model | string | Model identifier (default: llama-3.3-70b-versatile) |
Conditional
The conditional step evaluates conditions against the execution context and branches to different downstream steps.
{
"id": "route",
"name": "Route by Category",
"type": "conditional",
"config": {
"branches": [
{"condition": "category == 'urgent'", "next_step": "escalate"},
{"condition": "category == 'general'", "next_step": "auto_respond"}
]
}
}
Branches are evaluated in order. The first matching condition determines the next step. If no branch matches, the workflow proceeds to the next_step defined on the conditional step itself (if any), or terminates.
Loop
The loop step iterates over a collection from the execution context, running a sub-step for each item.
{
"id": "process_items",
"name": "Process Each Document",
"type": "loop",
"config": {
"collection": "{{input.documents}}",
"item_variable": "current_doc",
"body_step": "classify_doc"
},
"next_step": "aggregate"
}
Configuration:
| Field | Type | Description |
|---|---|---|
collection | string | Variable reference to the array to iterate over |
item_variable | string | Name of the variable holding the current item |
body_step | string | ID of the step to execute for each iteration |
Transform
The transform step applies data transformations -- formatting, filtering, mapping, or restructuring data between steps.
{
"id": "format_response",
"name": "Format Citizen Response",
"type": "transform",
"config": {
"operation": "format",
"template": "Dear Citizen,\n\nYour inquiry ({{input.reference_id}}) has been classified as: {{classify.output.category}}.\n\nDepartment: {{route.output.department}}"
}
}
API Call
The api_call step makes HTTP requests to external services, enabling integration with third-party systems, internal APIs, and external data sources.
{
"id": "notify",
"name": "Send Notification",
"type": "api_call",
"config": {
"url": "https://notifications.internal/api/send",
"method": "POST",
"headers": {"Content-Type": "application/json"},
"body": {
"recipient": "{{route.output.department_email}}",
"message": "New inquiry assigned: {{input.reference_id}}"
}
},
"timeout_seconds": 10
}
Human Approval
The human_approval step pauses the workflow and waits for a designated reviewer to approve or reject. This creates an auditable decision point in the workflow.
{
"id": "manager_review",
"name": "Manager Approval",
"type": "human_approval",
"config": {
"prompt": "Review permit application {{input.application_id}} with classification: {{classify.output.risk_level}}",
"approvers": ["department-manager"]
},
"next_step": "issue_permit"
}
When a workflow reaches a human approval step, the run status changes to waiting_approval. The workflow resumes only after explicit action through the dashboard or API.
Step Timeouts
Each step has an independent timeout (default 30 seconds). LLM calls and API calls should have timeouts tuned to their expected latency. Human approval steps do not time out automatically.
Step Execution Order
Steps execute sequentially following the next_step chain. Conditional steps create branches, and loop steps create iteration cycles. The engine tracks which steps have been executed and their outputs in the execution context, making all previous outputs available to subsequent steps.