Skip to main content
Shows how to run deterministic multi-step workflows from inside an agent using a custom run_workflow tool. The LLM decides when to call the tool and maps user intent to workflow_name and input; your orchestration engine runs the steps in order, retries on failure, and returns a structured result. Source: examples/agent_with_workflows/

What it demonstrates

  • Deterministic workflow execution — steps defined in your engine, not improvised by the LLM
  • WorkflowTool + WorkflowRunner interface — pluggable engine (in-process, Temporal, Conductor, Argo, etc.)
  • Agent waits until the workflow finishes — Execute blocks on WorkflowRunner.Run
  • Long-running config — AgentModeAutonomous, WithTimeout, WithToolExecutionConfig sized for workflow duration

Run

From examples/: In-process runner — no infrastructure needed:
Temporal runner — durable, survives restarts:
Requires LLM_APIKEY in examples/.env.

Key code

Execute blocks on WorkflowRunner.Run — the agent run stays open until the workflow finishes or a timeout fires.

Expected output

Learn more

Deterministic Execution

What deterministic means, wait semantics, timeouts, orchestration runners

Execution config

Tool execute timeout and max attempts