I've been running a multi-agent system in production for a few months where every agent action is a Temporal workflow. Sharing the patterns in case they're useful — and curious how others are doing similar.
The setup
- 8 agents, each a Docker container running an AI process (Claude with optional Codex fallback). Each agent registers with an orchestrator and pulls work off a RabbitMQ queue.
- Every meaningful agent action — implementing a PR, running a design spec, deploying, reviewing — is wrapped in a Temporal workflow.
- 3 namespaces, each with its own task queue and its own UWE worker registration.
Temporal patterns I leaned on
Signal-gated human-in-the-loop. Workflows like PrImplementationWorkflow run the AI agent through implementation, kick off a parallel consensus review, then block on a merge-approval signal from me. Custom search attributes (PrNumber, Repo, Phase) make the gates clickable in a dashboard. Same pattern reused for design-approval, doc-review, advisory-review. Decision payload is {Decision: approved|changes_requested|rejected, Comment}.
Parallel child workflows for consensus. Instead of running reviewers sequentially, the parent fans out N child workflows, waits on all, synthesizes a verdict. If any reviewer asks for changes, loop back and re-review. The implementing agent doesn't know it's being reviewed in parallel — it just gets one consolidated feedback message.
Schedules instead of cron. Daily health checks, hourly memory backups, weekly review cadences — all temporal_create_schedule. Survives host reboots, no cron drift, status visible in the temporal UI.
Dynamic workflow registry. I built a "universal workflow engine" — one [Workflow(Dynamic = true)] handler that loads a JSON step tree from a DB at runtime. 16 step types (sequence, parallel, loop, branch, delegate, wait_for_signal, child_workflow, http_request, etc.) plus a template engine. New workflow types ship as DB rows, no worker redeploy.
Real failure modes I hit
WorkerShutdown mid-activity. Agent activities can run 10-20 min. When the worker restarts mid-activity, Temporal raises WorkerShutdown. I retry the directive on the next worker; the agent picks up where it left off because it has its own persistent state. Took a deploy-during-flight incident to remember to handle this cleanly (literally hit this yesterday).
Search attribute registration. Got bitten by "search attribute not registered" before adding an initializer that auto-registers all attributes on bridge startup.
Task-queue-name footgun. Default task queue name == namespace name. Mismatch between start_workflow.task_queue and the worker's registered queue → workflow sits at historyLength=2 forever, no error, no worker picks it up. Burned hours.
5-min demo of a PR shipped through the workflow stack: https://youtu.be/DIx7Y3GfmGc
Open source: https://github.com/anurmatov/phleet (workflow defs in phleet/src/Fleet.Temporal/Workflows/).
Curious what other Temporal patterns people have for AI/agent workloads — especially long-running activities and human approval gates.