WithTemporalClient instead of WithTemporalConfig. You create and own the Temporal SDK client — required for TLS, API key auth, Temporal Cloud, and custom connection options.
Source: examples/agent_with_temporal_client/
What it demonstrates
client.Dialwith your ownclient.OptionsWithTemporalClient(tc, taskQueue)onNewAgent- Caller-owned client lifecycle (
defer tc.Close())
Run
Fromexamples/ with Temporal running:
TEMPORAL_HOST, TEMPORAL_PORT, TEMPORAL_NAMESPACE, and TEMPORAL_TASKQUEUE in .env.
Key code
WithTemporalConfig is sufficient — see Temporal runtime.
Expected output
LOG_LEVEL=debug. The response itself is identical to the simple-agent — the difference is the execution path (Temporal workflow vs in-process goroutine).
Learn more
Temporal Runtime
WithTemporalConfig vs WithTemporalClient
Agent Worker
Split client and worker