Skip to main content
Uses temporal.WithTemporalClient instead of temporal.WithTemporalConfig (from pkg/agent/runtime/temporal). 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.Dial with your own client.Options
  • temporal.WithTemporalClient(tc, taskQueue) on NewAgent
  • Caller-owned client lifecycle (defer tc.Close())

Run

From examples/ with Temporal running:
Set TEMPORAL_HOST, TEMPORAL_PORT, TEMPORAL_NAMESPACE, and TEMPORAL_TASKQUEUE in .env.

Key code

For simple local dev without custom dial options, WithTemporalConfig is sufficient — see Temporal runtime.

Expected output

The Temporal workflow ID and task queue are logged to stderr at 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