What are Flows?
Flows let you build repeatable, multi-step workflows. Combine steps that call AI models, retrieve or transform data, make decisions, call external APIs, and send results. Use a Flow when you can define the steps and branches before each run.
How Flows work
You configure each Flow as an ordered set of steps. Runtype runs the enabled steps in that order. A Conditional Logic step selects a branch based on its conditions. Later steps can use values from earlier steps through template variables.
When a step sets an outputVariable, reference that value by name in a later step. For example, a step with the output variable customerLookup makes {{customerLookup.tier}} available to later steps.
Example: customer support escalation
Suppose you are Dana, and you need to route customer support messages to the appropriate response path. Build the Flow with this sequence:
- Run Task: Analyze the message for sentiment and intent.
- Conditional Logic: Route negative sentiment to the escalation path.
- Get Record: Load the customer’s history from Records.
- Run Task: Generate a response that uses the customer’s history.
- Make API Call: Create a support ticket when escalation is required.
Example: review moderation
Suppose you need to moderate product reviews before you publish them. Flag spam, profanity, personal attacks, and promotional content without blocking legitimate reviews. Use this Flow pattern:
- Run Task: Send the review text to an AI model. Ask for a JSON object with violation categories and confidence scores. Set
outputVariabletoanalysis. - Run Code: Check whether any violation has a confidence score that exceeds your threshold. Set
outputVariabletoneedsReview. - Conditional Logic: If
{{needsReview}}istrue, route the review to manual review. Otherwise, approve it. - Make API Call: On the approval path, call your publishing API to publish the review.
- Make API Call: On the manual review path, send the review and
{{analysis}}to your moderation queue.
To test this Flow, run it in the editor with representative inputs. Review each step’s input, output, status, and execution time. Change the threshold in Run Code. Test both conditional paths and compare the results with your expected outcomes.
Available step types
Runtype groups Flow steps into AI, Context, Actions, and Replies categories. Common step types include:
- Run Task: Send a prompt to an AI model and get a response.
- Run Agent: Run a conversational AI step with message history and tool calling.
- Fetch URL: Fetch content from a URL.
- Get Record and List Records: Load one Record or an array of matching Records.
- Upsert Record and Update Record: Create or update Record data.
- AI Search: Search the web with an AI model or search provider.
- Make API Call: Send an HTTP request to an external service.
- Send Email: Send an email with HTML or plain-text content.
- Wait Until: Pause the Flow or poll an API until a condition is met.
- Render Template and Generate PDF: Create documents from templates or HTML and markdown.
- Run Code: Transform data or apply custom JavaScript logic in a sandbox.
For the complete list and descriptions, see Flow step types overview.
Template variables
Use template variables to pass data between steps and reference Flow inputs.
To provide input through the Runtype API, include values in the inputs field. Reference each value by its key. For example, use {{customerName}}. For a record-based execution, read the customer_status metadata property with {{_record.metadata.customer_status}}.
System variables include {{_flow.name}}, {{_execution.timestamp}}, and {{_record.id}}. Use these variables when a step needs Flow, execution, or Record context.
For example, use step outputs and input variables in a prompt:
In this example, messageText is a Flow input, and customerLookup is the output object from an earlier step.
Compare Flows and Agents
The following table compares Flows and Agents by how they choose and run work.
Choose a Flow when you can list the required steps and branches before a run. Choose an Agent when the model must select the next action based on the goal, available tools, or earlier results.
Next steps
Use these guides to continue:
- Creating and editing flows: create, test, and publish a Flow.
- Flow variables and templates: pass data between steps.
- What are Records?: store and retrieve structured data.
- What are Agents?: use model-selected actions for dynamic tasks.
- Flow versioning and publishing: test drafts and publish changes.