Architecture
| Process | Role |
|---|---|
Agent (NewAgent + DisableLocalWorker) | Starts Run, Stream, RunAsync; handles approvals in your UI |
Worker (NewAgentWorker) | Polls the task queue; executes LLM calls, tools, memory, and approvals as Temporal activities |
| Temporal | Durable workflow history — survives crashes and deploys |
Setup
Worker process — polls the task queue and executes runs:NewAgentWorker requires Temporal — it cannot run with the in-process runtime alone.
Configuration alignment
Both processes must share identical agent configuration:| Must match | Why |
|---|---|
| Task queue and namespace | Worker polls what the client submits to |
WithInstanceId (if set) | Derives {TaskQueue}-{InstanceId} on both sides |
| LLM client, system prompt, tools | Fingerprint check at activity entry |
| Tool approval policy and execution mode | Same approval semantics |
| MCP, A2A, sub-agent setup | Same tool surface for the LLM |
| Conversation backend | Redis (not in-memory) for remote workers |
| Memory config | Same store and scope settings |
| Hook group names | Fingerprint includes hook group names |
| Observability config | Same OTLP endpoint on both processes |
WithDisableFingerprintCheck bypasses the check on the agent process only — not allowed on NewAgentWorker. Use as break-glass only.
Remote workers for streaming and approvals
When usingDisableLocalWorker with streaming or approvals across processes, also pass EnableRemoteWorkers() on the agent:
Distributed conversation and memory
In-memory conversation fails at build time with remote workers. Use Redis or another distributed backend on both processes:Sub-agents
Each sub-agent typically runs on its own task queue with its own worker. PairNewAgentWorker with the same options as the NewAgent that runs that sub-agent.
Example: Agent Worker · Durable Agent.
Example
Agent Worker
Minimal split client and worker
Related
Temporal Runtime
Durable execution and fingerprint alignment
Multiple Agents
Task queues and instance IDs
Observability
OTLP on both agent and worker
Agent Modes
Interactive vs autonomous worker checks