Documentation
¶
Overview ¶
agent_with_workflows demonstrates deterministic workflow execution inside an agent.
The goal: the LLM routes user intent to a named procedure; the procedure runs step-by-step in an orchestration engine (validate → execute → return result). Steps, retries, and ordering are defined by the engine — not improvised by the LLM.
workflow_tool.go — WorkflowTool and WorkflowRunner interface (engine-agnostic) inprocess_runner.go — default runner (no infrastructure required) temporal_runner.go — sample Temporal runner; activate with ORCHESTRATION_ENGINE=temporal
Run (in-process, no infra needed):
go run ./agent_with_workflows "Run the onboarding workflow for Alice"
Run (Temporal engine):
task infra:temporal:up && task infra:temporal:wait ORCHESTRATION_ENGINE=temporal go run ./agent_with_workflows "Run the onboarding workflow for Alice"
Package main — sample WorkflowRunner backed by Temporal.
This file is the Temporal-specific orchestration layer for the agent_with_workflows example. It satisfies the WorkflowRunner interface defined in workflow_tool.go.
To use a different engine (Conductor, Argo Workflows, Step Functions, in-process), add a sibling file (e.g. conductor_runner.go) implementing WorkflowRunner and wire it in main.go instead of NewTemporalRunner.
Package main implements a WorkflowTool that lets the LLM invoke deterministic user-defined workflows inside an agent run. The tool contract (name, parameters, WorkflowRunner interface) is engine-agnostic — execution is handled by whatever WorkflowRunner is wired in main.go (see temporal_runner.go for a Temporal sample).