Workflow Protocol - Management API
Low-level description of the Workflow building block internals.
This document specifies the Dapr Workflow protocol and runtime contract at a low level. It targets SDK authors building Workflow Workers and runtime maintainers evolving the Dapr sidecar’s Workflow Engine.
Dapr Workflow implements a sidecar-as-scheduler pattern: the Dapr runtime (sidecar) acts as the Workflow Engine, and the application SDK acts as the Workflow Worker. All control and execution traffic flows over gRPC.
There are two protocol surfaces:
TaskHubSidecarService).Key Components
Workflow Engine (Dapr Sidecar)
Manages workflow state transitions, history persistence, scheduling of orchestration and activity tasks, and reliable delivery semantics. By default, it leverages Dapr Actors as the backend for durable, partitioned execution.
Workflow Worker (Application SDK)
Connects to the sidecar, polls for orchestration and activity work items, executes user-defined logic, and returns results, failures, and heartbeats to the engine. Orchestration logic must be deterministic; activity logic need not be.
Orchestration
The deterministic coordinator that defines the workflow. The engine drives orchestrations via history replay to rebuild state and schedule outbound tasks (activities, sub-orchestrations, timers, external events).
Activity
The atomic unit of work. Activities are executed at-least-once and report results or failures back to the engine. Idempotency is recommended and task execution identifiers are available on context to assist with this.
State Store & Backend
Workflow history and state are durably persisted. The engine typically implements a task hub pattern over the chosen persistence and uses Dapr Actors as the default reliability substrate.
Dapr Workflow is based on the Durable Task Framework (DTFx) execution semantics:
Orchestrators are replayed from their event history to rebuild deterministic state. All nondeterministic operations (time, random values, I/O) must be mediated by the engine (e.g., timers, activity calls, external events).
Orchestrator code must be side-effect free except via engine-mediated effects. Control flow must be reproducible during replay.
Activities may be delivered more than once. The engine ensures workflow state commits are idempotent and applied exactly once.
The sidecar owns scheduling and persists all history/events before dispatching work to workers. Workers are stateless executors from the engine’s perspective.
Note: See: Management API specification for exact RPC shapes, error codes and semantics.
Note: See Execution API specification defining
TaskHubSidecarServicecontracts, payload schemas and sequencing rules.
StartWorkflow via the Management API.ExecutionStarted) and materializes an instance.TaskHubSidecarService worker protocol, work item contracts, result/failure reporting, and sequencing.Low-level description of the Workflow building block internals.
Low-level description of the Workflow building block internals.
Low-level description of the Workflow building block internals.
Low-level description of the Workflow building block internals.
Low-level description of the Workflow building block internals.
Low-level description of the Workflow building block internals.