Skip to content

Block Type Reference

Compact lookup reference for all six block types. For detailed explanations and common patterns, see Block Types.

Every block inherits these fields regardless of type.

FieldTypeDefaultConstraintsDescription
typestrrequiredBlock type discriminator (linear, gate, code, loop, workflow, dispatch, synthesize)
statefulboolfalseMaintain conversation history across re-invocations
dependsstr or List[str]nonenon-blankUpstream block dependencies
error_routestrnonenon-blankTarget block on error
inputsDict[str, InputRef]noneExplicit upstream data references (each entry has a from field)
outputsDict[str, str]noneOutput field name to type string mapping
output_conditionsList[CaseDef]nonemutually exclusive with routesNamed output branches
routesList[RouteDef]nonemutually exclusive with output_conditions, requires exactly one defaultShorthand routing
exitsList[ExitDef]noneNamed exit ports for branching
exit_conditionsList[ExitCondition]noneOutput pattern to exit handle mapping
assertionsList[Dict[str, Any]]noneBlock-level quality assertions
retry_configRetryConfignoneRetry on failure
timeout_secondsint3001—3600Block execution timeout in seconds
stall_thresholdsDict[str, int]nonePer-phase stall detection thresholds
limitsBlockLimitsDefnonePer-block budget constraints

Single LLM call through a soul.

FieldTypeDefaultRequiredDescription
typeLiteral["linear"]"linear"yesType discriminator
soul_refstryesSoul ID to use for this block
minimal linear block
blocks:
research:
type: linear
soul_ref: researcher

LLM quality gate — evaluates another block’s output and routes on pass/fail.

FieldTypeDefaultRequiredDescription
typeLiteral["gate"]"gate"yesType discriminator
soul_refstryesSoul ID for the gate evaluator
eval_keystryesBlock ID whose output is being evaluated
extract_fieldstrnonenoJSON field to extract before evaluation
passstrnonenoTarget block on pass (shorthand). Must be set with fail.
failstrnonenoTarget block on fail (shorthand). Must be set with pass.

When pass and fail are omitted, the gate auto-creates two ExitDef entries with IDs "pass" and "fail".

minimal gate block
blocks:
quality_check:
type: gate
soul_ref: reviewer
eval_key: draft
pass: publish
fail: revise

Sandboxed Python code execution. No LLM calls.

FieldTypeDefaultRequiredDescription
typeLiteral["code"]"code"yesType discriminator
codestryesPython source code containing def main(data)
timeout_secondsint30noExecution timeout (overrides base default of 300)
allowed_importsList[str]["json", "re", "math", "datetime", "collections", "itertools", "hashlib", "base64", "time", "urllib.parse"]noWhitelist of importable modules

The main function receives a data dict with keys results, metadata, and shared_memory. It must return a JSON-serializable value. If the return value is a dict containing exit_handle, that value is extracted and used as the block’s exit handle.

minimal code block
blocks:
transform:
type: code
code: |
def main(data):
return {"count": len(data.get("results", {}))}

Iterates inner blocks for multiple rounds with optional break conditions.

FieldTypeDefaultRequiredConstraintsDescription
typeLiteral["loop"]"loop"yesType discriminator
inner_block_refsList[str]yesmin 1 itemBlock IDs to execute each round
max_roundsint5no1—50Maximum iterations
break_conditionConditionDef or ConditionGroupDefnonenoCondition evaluated against last inner block’s output
carry_contextCarryContextConfignonenoContext propagation between rounds
break_on_exitstrnonenoExit handle value that triggers loop break
retry_on_exitstrnonenoExit handle value that triggers another round
FieldTypeDefaultDescription
enabledbooltrueEnable context carrying
modestr"last""last" (previous round only) or "all" (accumulate all rounds)
source_blocksList[str]noneSpecific blocks to carry from (default: all inner blocks). Must be subset of inner_block_refs.
inject_asstr"previous_round_context"Key name for injected context in shared_memory
minimal loop block
blocks:
refine:
type: loop
inner_block_refs: [draft, review]
max_rounds: 3
break_on_exit: pass

Executes a child workflow as a sub-step (Hierarchical State Machine pattern).

FieldTypeDefaultRequiredDescription
typeLiteral["workflow"]"workflow"yesType discriminator
workflow_refstryesID of the child workflow file to execute
inputsDict[str, str]nonenoInterface name to parent state path mapping. Keys must not contain dots.
outputsDict[str, str]nonenoParent path to interface name mapping. Values must not contain dots.
max_depthintnonenoMaximum nesting depth limit (default engine limit is 10)
on_errorstr"raise"no"raise" (propagate error) or "catch" (absorb error, continue parent)
minimal workflow block
blocks:
sub_pipeline:
type: workflow
workflow_ref: analysis-pipeline
inputs:
topic: results.research
outputs:
results.summary: analysis_result

Combines outputs from multiple upstream blocks into a single result via an LLM.

FieldTypeDefaultRequiredDescription
typeLiteral["synthesize"]"synthesize"yesType discriminator
soul_refstryesSoul ID for the synthesizer
input_block_idsList[str]yesBlock IDs whose outputs are combined (must be non-empty)
minimal synthesize block
blocks:
combine:
type: synthesize
soul_ref: synthesizer
input_block_ids: [research, code_review, design]

Parallel branching — each exit port gets its own soul and task instruction. All branches execute concurrently.

FieldTypeDefaultRequiredDescription
typeLiteral["dispatch"]"dispatch"yesType discriminator
exitsList[DispatchExitDef]yesExit port definitions with per-branch soul and task
FieldTypeRequiredDescription
idstryesUnique exit port ID
labelstryesHuman-readable label
soul_refstryesSoul ID for this branch
taskstryesTask instruction for this branch’s soul

Results are stored per-exit at state.results["{block_id}.{exit_id}"] and combined at state.results[block_id] as a JSON array.

minimal dispatch block
blocks:
analyze:
type: dispatch
exits:
- id: sentiment
label: Sentiment Analysis
soul_ref: sentiment_analyst
task: Analyze the sentiment of the input text.
- id: entities
label: Entity Extraction
soul_ref: entity_extractor
task: Extract all named entities from the input.