Execution Modes

Copy page

Choose between classic and durable execution modes for your agents.

Every agent runs in one of two execution modes: Classic or Durable. The mode determines how the agent's execution lifecycle is managed — specifically how state is handled during LLM calls, tool execution, and error recovery.

Classic mode (default)

Classic mode runs the entire agent request in a single in-process loop. The LLM call, tool execution, and response streaming all happen within one HTTP request lifecycle.

  • Tokens stream to the client word-by-word with minimal latency (~100ms time-to-first-byte)
  • Tool approvals are supported
  • Stream resumption is supported via persisted stream chunks
  • If the server process crashes mid-execution, the request is lost

Best for: Interactive chat where streaming responsiveness matters most.

Durable mode

Durable mode wraps agent execution in a workflow with persistent checkpoints. Each phase of execution (initialize, call LLM, execute tools, complete) is a separate step that persists its result before proceeding.

  • Execution state is persisted to the workflow backend
  • If the server crashes, the workflow can resume from the last completed step
  • Tool approval suspends the workflow until the user responds, then resumes
  • Stream data is persisted by the workflow runtime for client reconnection
  • Higher time-to-first-byte (~2s) due to workflow step transitions

Best for: Agents with tool approval workflows, long-running executions, or environments where crash recovery is important.

Choosing a mode

ConsiderationClassicDurable
Streaming latency~100ms TTFB~2s TTFB
Crash recoveryNoYes
Tool approvalIn-memory (request-scoped)Persistent (workflow-scoped)
Multi-step tool executionSame requestSeparate workflow steps
Stream resumptionVia stream chunks tableVia workflow storage

For most interactive chat use cases, Classic mode provides the best user experience. Switch to Durable when you need persistent tool approvals or crash recovery guarantees.

Setting the execution mode

In the Visual Builder

Open your agent's settings panel and find the Execution mode section. Select either Classic or Durable from the dropdown. This sets the default for all requests to this agent.

Per-request override

Clients can override the agent's default execution mode by passing executionMode in the request body:

{
  "messages": [{ "role": "user", "content": "Hello" }],
  "executionMode": "durable"
}

When provided, executionMode in the request takes precedence over the agent's configured default. This allows the same agent to handle both low-latency interactive chat (classic) and crash-recoverable workflows (durable) depending on the client's needs.

On this page