WithTemporalConfig or WithTemporalClient when you need durable, production-grade execution.
Your agent code (NewAgent, tools, prompts, streaming) stays the same. Only the configuration changes.
Comparison
| In-process | Temporal | |
|---|---|---|
| Enable | Default — omit Temporal options | WithTemporalConfig or WithTemporalClient |
| Infrastructure | None beyond your LLM provider | Running Temporal server or Temporal Cloud |
| Where the loop runs | Inside your Go process | Durable workflow + activities |
| Crash recovery | No — run is lost if the process exits | Yes — workflow history replays from last step |
| Horizontal scale | Single process only | Add workers on task queues |
| Split client / worker | Not applicable | DisableLocalWorker + NewAgentWorker |
| Feature parity | Full | Full |
| Conversation backend | In-memory (single process) | Redis for split-process deployments |
When to use in-process
- Developing, testing, or prototyping
- Short-lived runs where crash recovery is not needed
- Zero-infrastructure deployments (serverless, scripts, single binary)
When to use Temporal
- Agent runs must survive process crashes, deploys, and restarts
- You need horizontal scaling by adding workers
- You want to split the agent client and worker across separate processes
- Long-running agent sessions require durable orchestration
How runtime selection works
The SDK selects a backend from yourNewAgent options. You never instantiate a runtime directly.
Switching runtimes
- Develop with no Temporal options
- Add
WithTemporalConfig(orWithTemporalClient) for production - If you use conversation with a split-process deployment (agent + separate worker), switch from in-memory to Redis. See Conversation
Related pages
In-Process
Default runtime — zero infrastructure
Temporal
Durable workflows, workers, and production deployment
Configuration
WithTemporalConfig, DisableLocalWorker, and all runtime options
Architecture
How the agent loop maps to each backend