Skip to main content
Orchestration

Workflow Automation

Orchestrate multi-step agent tasks with durable workflows.

  • Durable workflows that survive crashes and restarts
  • Multi-step orchestration with sessions, file operations, and process execution
  • Error handling and retry via ctx.step() for each operation
  • Agent chaining where output of one session feeds into the next

Basic workflow

Use the actor workflow() primitive to orchestrate a multi-step agent task. Each step is durable and will resume from where it left off after a restart.

Session creation and prompting must happen within the same step because sessions are ephemeral and won’t survive a replay.

Agent chaining

Output of one agent session feeds into the next. Each session is created and completed within its own step.

Recommendations

  • Create and close sessions within the same step. Sessions are ephemeral and won’t exist after a workflow replays.
  • Pass data between steps via the filesystem or step return values, not session state.
  • Keep step names stable across code changes. Renaming a step breaks replay for in-progress workflows.
  • Use separate actors for the workflow orchestrator and the agentOS VM.
  • See Workflows for the full workflow API reference including timers, joins, and races.