Skip to main content
Agent SDK for Go supports three execution backends. In-process is the default — pass no Temporal or Restate options — and is durable by default via durable-go, with no extra infrastructure. Temporal and Restate are opt-in distributed backends — import pkg/agent/runtime/temporal or pkg/agent/runtime/restate and add the matching config option when you need multi-process/horizontally-scaled execution. Your agent code (NewAgent, tools, prompts, streaming) stays the same. Only the configuration changes.

Comparison

When to use in-process

  • Any single-process deployment that still wants crash recovery — this is the default, not a tradeoff
  • Zero-infrastructure deployments (serverless, scripts, single binary)
  • Skip it only if you need horizontal scaling or a client/worker split — that’s what Temporal/Restate add
See In-Process for details, the durability knobs, and the one remaining limitation (reconnect fidelity).

When to use Temporal

  • You need horizontal scaling by adding workers on a task queue
  • You want to split the agent client and worker across separate processes (NewAgentWorker)
  • Reconnect needs token-level fidelity (original AG-UI events replay, not coalesced steps)
  • You want mature, battle-tested workflow orchestration tooling (Temporal Web UI, etc.)
Crash recovery alone is not a reason to reach for Temporal — in-process already has it. See Temporal for cluster setup and SDK connection.

When to use Restate

  • You want durable orchestration with Restate’s ingress + embedded endpoint model
  • You need multiple registered endpoint deployments for scale
  • Reconnect needs token-level fidelity (original AG-UI events replay, not coalesced steps)
Crash recovery alone is not a reason to reach for Restate — in-process already has it. See Restate for server setup and SDK connection.

How runtime selection works

The SDK selects a backend from your NewAgent options. You never instantiate a runtime directly.
Provide either Temporal options or restate.WithRestateConfig, not both. For Temporal alone, provide either WithTemporalConfig or WithTemporalClient, not both.

Switching runtimes

In-process is already durable in development and production. Add Temporal or Restate only when you need distributed/horizontally-scaled execution — the agent code (tools, prompts, streaming, approvals) does not change.
  1. Start in-process with no Temporal or Restate options — durable by default
  2. Add temporal.WithTemporalConfig (or WithTemporalClient) or restate.WithRestateConfig when you need multi-process/horizontal scale
  3. If you use conversation with a Temporal split-process deployment (agent + separate worker), switch from in-memory to Redis. See Conversation

In-Process

Default runtime — zero infrastructure

Temporal

Durable workflows, workers, and production deployment

Restate

Durable invocations with an embedded SDK endpoint