Anatomy of a Workflow
A workflow consists of:- Metadata: Name, description, categories, tags, visibility
- Versions: Each version holds a complete definition
- Definition: Steps, input/output schema, retry config, and timeouts
Definition Fields
Steps
Each step defines an operation in the workflow. Steps can be model invocations, HTTP requests, Python functions, parallel branches, conditional logic, or simple pass-through operations.Base Step Fields
All step types share these fields:Retry Configuration
Step Types
Model Steps
Invoke an AI model from the each::api catalog.HTTP Steps
Make HTTP requests to external APIs or services.Auth Configuration
Python Steps
Execute Python code within the workflow.Parallel Steps (Branching)
Usetype: "parallel" to run multiple branches concurrently. Each branch contains its own sequence of steps that execute independently.
Branch Fields
All branches kick off at the same time and run independently. The parallel step wraps up once every branch finishes.
Choice Steps (Conditional Logic)
Usetype: "choice" to route execution based on a condition. The workflow evaluates the condition and picks either the condition_met_branch or the default_branch.
Condition Types
Conditions can be simple (single comparison) or logical (combining multiple conditions).Simple Condition
Compares a single expression against a value:Logical Conditions
Combine multiple simple conditions usingand, or, or not:
Condition Operators
Comparison Operators
String Operators
Array Operators
Existence Operators
Existence operators (
exists, not_exists, is_null, is_not_null) do not require a value field in the condition.Choice Branch Fields
Pass Steps
A pass-through step that does no processing. Super handy for injecting static values or as a placeholder.Input Schema
Define what inputs your workflow accepts using JSON Schema:Execution Flow
Steps run sequentially by default. Each step’s output is available to subsequent steps via parameter references. Parallel and choice steps let you add branching and conditional logic into the mix.Step Outputs
Each completed step produces aStepOutput:
Choice Step Output
For choice steps, the output includes which branch was selected:Fallback Output
When a fallback kicks in, a separate step output appears with a_fallback suffix:
primary_failed (the primary step failed and fallback kicked in) or not_triggered (primary succeeded, so fallback was skipped).