Introduction
The Cadence API is organized into three core services that work together to orchestrate distributed workflows:- Frontend Service: Public-facing API for workflow and domain management
- History Service: Internal service managing workflow execution state and history
- Matching Service: Internal service handling task distribution and polling
Service Architecture
API Services
Frontend Service
The Frontend Service is the primary entry point for Cadence clients. It provides APIs for:- Starting and managing workflow executions
- Registering and managing domains
- Querying workflow state and history
- Polling for decision and activity tasks
- Recording task completions and failures
History Service
The History Service maintains workflow execution state and event history. It handles:- Workflow execution lifecycle management
- Event history persistence and retrieval
- Mutable state management
- Cross-cluster replication
- Workflow reset and recovery operations
Matching Service
The Matching Service coordinates task distribution between workflow workers and the Cadence cluster:- Task list management and partitioning
- Long-polling for decision and activity tasks
- Task routing and load balancing
- Query workflow execution
Type Definitions
Cadence uses strongly-typed request/response structures organized by functional area:Workflow Types
Workflow execution, decision, and activity types
Domain Types
Domain configuration and replication types
Task Types
Decision task and activity task types
Common Types
Shared types used across all services
API Conventions
Request/Response Pattern
All Cadence APIs follow a consistent request/response pattern:Error Handling
Cadence uses typed errors for well-known failure scenarios:BadRequestError: Invalid request parametersEntityNotExistsError: Requested entity not foundDomainNotActiveError: Domain is not activeServiceBusyError: Service is throttling requestsWorkflowExecutionAlreadyStartedError: Workflow already running
Common Parameters
| Parameter | Type | Description |
|---|---|---|
DomainUUID | string | Unique identifier for the domain |
Domain | string | Human-readable domain name |
WorkflowExecution | object | Workflow ID and Run ID |
TaskList | object | Task list name and type |
Identity | string | Worker or client identity |
Authentication & Authorization
Cadence supports pluggable authorization through theAuthorization interface:
- Domain name
- API name
- Permission type (Read/Write)
- Request context
Rate Limiting
All services implement rate limiting at multiple levels:- Global rate limiting: Per-service RPS limits
- Domain rate limiting: Per-domain RPS limits
- Worker rate limiting: Per-worker RPS limits
ServiceBusyError with retry-after information.
Protocol Support
Cadence services support multiple wire protocols:- Thrift: Legacy protocol for backward compatibility
- gRPC: Modern protocol with better performance and streaming support
common/types are protocol-agnostic, with mappers handling conversion to/from wire formats.
SDK Integration
The API reference describes the server-side APIs. For client-side development, use the official Cadence SDKs: SDKs provide higher-level abstractions and handle:- Connection management
- Automatic retries
- Task polling and dispatch
- Workflow and activity registration
Next Steps
Frontend Service
Explore public-facing workflow APIs
Type Definitions
Learn about core type definitions