RunAsync calls simultaneously on one Agent instance. Each run gets its own Temporal workflow (or local goroutine) — no separate Agent per request required.
Source: examples/agent_with_concurrent_runs/
What it demonstrates
RunAsync+sync.WaitGroupfor fan-out across one agent- Results printed as they arrive (arrival order varies)
- Runtime-agnostic:
localandtemporalboth supported viaAGENT_RUNTIME
Run
Fromexamples/:
Key code
RunAsync returns immediately; the goroutine blocks on <-asyncCh until that run completes. All runs are in flight simultaneously on the same Agent.
Expected output
Learn more
Multiple Agents
Separate agent instances with distinct task queues
Run Async
Non-blocking RunAsync with result channel