The execution engine is the run worker responsible for:
- accepting run requests from the control plane
- enforcing idempotent run lifecycle behavior
- fetching bootstrap and context from the control plane
- running the reasoning loop
- streaming events and final commit back to the control plane
- delegating LLM and tool access to the gateway
flowchart LR
CP[control-plane]
EE[Execution Engine]
GW[llm-gateway]
Worker[Worker loop]
Registry[Run registry]
CP --> EE
EE --> Registry
EE --> Worker
Worker --> CP
Worker --> GW
flowchart TD
subgraph API[Service Entry]
FastAPI[execution_engine/app.py]
StartRun[POST /api/v1/runs]
CancelRun[POST /api/v1/runs/{run_id}/cancel]
Health[health + readiness + metrics]
end
subgraph Runtime[Run Runtime]
Registry[run_registry.py]
Worker[worker.py]
Engine[agent/engine.py]
Tools[agent/tools.py]
Events[event manager / event emission]
end
subgraph Integrations[Service Clients]
OrchClient[orchestrator_client.py]
GatewayClient[gateway_client.py]
end
subgraph External[External Systems]
CP[control-plane]
GW[llm-gateway]
end
FastAPI --> StartRun
FastAPI --> CancelRun
FastAPI --> Health
StartRun --> Registry
CancelRun --> Registry
Registry --> Worker
Worker --> Engine
Engine --> Tools
Worker --> Events
Worker --> OrchClient
Worker --> GatewayClient
Tools --> GatewayClient
OrchClient --> CP
GatewayClient --> GW
- maintain queued, running, and terminal run state
- fetch authoritative execution snapshots and chat context from control-plane
- run the agent reasoning loop and handle tool-call iterations
- emit ordered run events and final completion payloads
- avoid direct provider secret handling by using llm-gateway