Workflows

Examples for saving and loading workflows with advanced step types.

The conditional, loop, parallel, and router research examples include setup adjustments that preserve tools across save and load. Apply them before creating the saved configuration.

ExampleDescription
Save Conditional Workflow StepsSave a workflow whose Condition evaluator is a plain function, then reload it from Postgres by registering that function in a Registry.
Save Custom Executor Workflow StepsRegister a custom executor function in a Registry so a saved workflow's non-agent step resolves on load from Postgres.
Save Loop Workflow StepsPersist a Loop step whose end_condition function is restored from a Registry, iterating HackerNews and web research up to 3 times before summarizing.
Save Parallel Workflow StepsSave parallel research steps with explicit models and a Registry to restore their executable tools.
Save Router Workflow StepsPersist a Router whose keyword-based selector function is restored from a Registry, dispatching topics to HackerNews or web research before summarizing.
Registry Agents in WorkflowExpose stable agent IDs through the registry for unpinned workflow references.
Save HITL Condition, Loop, and Router StepsRound-trip requires_confirmation, on_reject, and route-selection settings on Condition, Loop, and Router through workflow save/load, then drive the pauses with corrected menu-to-route mapping.
Save HITL Confirmation Workflow StepsSave a workflow whose ProcessData step requires confirmation, reload it via get_workflow_by_id with a Registry, and confirm or skip the paused step at run time.
Save HITL User Input Workflow StepsConvert input fields to serializable dictionaries before saving, then reload and fill the paused step's fields.