Expand description
Multi-step agent workflow engine with DAG execution.
The WorkflowEngine allows registering named workflows composed of
sequential steps or DAG-structured steps with parallel fan-out, conditional
branching, loops, and advanced error handling.
§Variable substitution
Prompt templates support:
{{input}}/{{previous_output}}— current pipeline input{{step_name}}— name of the current step{{step_N}}— output of step N (1-indexed, sequential mode){{some_step_name}}— output of a step by name{{step_name.output}}— explicit step output reference{{step_name.status}}— step completion status{{step_name.duration_ms}}— step duration{{loop.index}}— current loop iteration{{loop.item}}— current loop item (ForEach){{step_name.output.field.nested}}— JSON path into step output{{step_name.output | uppercase}}— data transformation
Structs§
- Circuit
Breaker State - Tracks circuit breaker state per-step across workflow runs.
- DagExecution
Result - Result of executing a DAG workflow.
- DagWorkflow
- A DAG workflow definition with parallel execution support.
- DagWorkflow
Step - A single step within a DAG workflow.
- Dead
Letter Entry - A failed step result stored in the dead letter queue.
- Execution
Trace Entry - An entry in the execution trace showing what happened at each “wave” of execution.
- Step
Result - Result of executing a single workflow step.
- Workflow
- A workflow definition composed of sequential steps (legacy).
- Workflow
Engine - Engine for registering and executing multi-step agent workflows.
- Workflow
Id - Unique identifier for a workflow definition.
- Workflow
Run - A single execution of a workflow.
- Workflow
RunId - Unique identifier for a workflow run (execution instance).
- Workflow
Step - A single step within a sequential workflow (legacy format, still supported).
Enums§
- OnError
- What to do when a workflow step fails.
- Step
Status - Per-step execution status.
- Workflow
RunStatus - Status of a workflow run.
Traits§
- Step
Executor - A step executor trait that allows testing the DAG engine without real LLM calls.
Functions§
- execute_
dag - Execute a DAG workflow using the provided step executor.
- expand_
dag_ variables - Replace template variables in a prompt string (DAG mode).