Flows are multi-step AI workflows that let you chain together prompts, API calls, data transformations, and logic to build powerful AI-powered processes without writing a full application.
With Flows, you define the exact steps you want to run, in the order you want them. This gives you full control over how your AI features behave and makes them easier to test, debug, and refine.
A Flow executes a sequence of steps you define. Each step performs a specific task, such as calling an AI model, fetching data from an API, transforming data, making decisions, or working with Records. Steps can pass data to each other using template variables, so the output of one step becomes the input for the next.
A SaaS company needs to moderate user-submitted product reviews before publishing them. The team cannot manually review hundreds of submissions each day, but it needs accuracy and wants to avoid rejecting legitimate reviews.
A developer builds a content moderation Flow with these steps:
analysis.needsReview.{{needsReview}} is true, route to manual review. Otherwise, auto-approve.{{analysis}} to the internal moderation queue so reviewers can see the AI’s reasoning.During testing, the developer notices too many borderline cases getting flagged. They adjust the confidence threshold in the Transform Data step, rerun test cases in the Playground, and see the false positive rate drop without missing real violations.
Once in production, most reviews auto-approve and the moderation team can focus on genuinely ambiguous cases. Because the Flow follows a defined sequence of steps, edge cases are easy to trace and the logic is straightforward to refine.
Use the Playground to iterate quickly on your Flow logic before deploying to production. You can test different inputs and see how each step behaves.
Runtype provides a wide range of step types to cover common workflow needs. Some of the most common include:
See Flow step types overview for the complete list.
Template variables let you pass data between steps in your Flow.
Using step outputs: When you configure a step, you give its output a variable name. Later steps can reference that output using {{variableName}}. For example, if a step outputs to customerLookup, you can use {{customerLookup.tier}} or {{customerLookup.count}} in a later step.
Providing input to a Flow: When you trigger a Flow through the API, you can pass values in the inputs field and reference them as {{varName}}, such as {{customerName}}. For Record-based execution, access Record metadata with {{_record.metadata.fieldName}}.
System variables like {{_flow.name}} and {{_execution.timestamp}} are also available.
Example prompt using variables:
Use Flows when you know the steps needed to accomplish a task. Flows run through your defined steps and complete, which gives you full visibility into what happened and why.
Use Agents when the AI should decide how to accomplish a goal. Agents reason, call tools, and evaluate results in a loop, which makes them well suited for tasks that require multiple rounds of decision-making or conversational interactions.
Start with Flows for most use cases. They are easier to debug, more predictable, and faster to execute. You can introduce Agents later when you need autonomous decision-making.