Skip to main content

Introduction to Cadence

Cadence is an open-source platform for building and running scalable, fault-tolerant, and long-running workflows. Since 2017, Cadence has been empowering developers to write complex distributed applications as simple procedural code.

What is Cadence?

Cadence Workflow is a distributed orchestration engine that executes asynchronous, long-running business logic in a scalable and resilient way. It allows you to write your workflow logic as straightforward procedural code, while Cadence handles:
  • Fault tolerance: Automatic retries and error handling
  • State persistence: Workflow state is automatically persisted and recovered
  • Scalability: Distribute workload across multiple workers
  • Visibility: Track and query workflow execution history
  • Versioning: Safe deployment of workflow code changes

Key Use Cases

Cadence excels at orchestrating complex, distributed operations:

Microservice Orchestration

Coordinate multiple microservices into reliable, long-running business processes

Data Pipelines

Build resilient ETL workflows that handle failures and retries automatically

Infrastructure Provisioning

Orchestrate complex deployment and provisioning workflows with automatic rollback

Human-in-the-Loop

Implement approval workflows that wait for human input for days or weeks

Core Benefits

Fault Tolerance by Design

Cadence automatically handles failures at every level:
// Activities are automatically retried on failure
func YourActivity(ctx context.Context, input string) error {
    // If this fails, Cadence retries it automatically
    return callExternalService(input)
}

Durable Execution

Workflow state is automatically persisted. Your workflows can:
  • Sleep for days, months, or years
  • Survive process restarts and deployments
  • Resume exactly where they left off after any failure

Simple Programming Model

func HelloWorldWorkflow(ctx workflow.Context, name string) (string, error) {
    // Execute activity with timeout
    ao := workflow.ActivityOptions{
        ScheduleToCloseTimeout: time.Minute,
    }
    ctx = workflow.WithActivityOptions(ctx, ao)
    
    var result string
    err := workflow.ExecuteActivity(ctx, SayHello, name).Get(ctx, &result)
    return result, err
}

Architecture Overview

Cadence consists of multiple services that work together to provide a robust workflow orchestration platform.
A Cadence deployment includes:
  • Frontend Service: Handles all client API requests
  • History Service: Maintains workflow execution state and history
  • Matching Service: Routes tasks to workers via task lists
  • Worker Service: Handles internal background operations
  • Database: Stores workflow state (Cassandra, MySQL, PostgreSQL, or MongoDB)
  • Workers: Your application code that executes workflows and activities

Getting Started

Ready to build your first workflow? Here’s what you need:
1

Install Cadence

Set up the Cadence server locally using Docker or build from sourceLearn more in the Installation Guide
2

Run Your First Workflow

Follow our quickstart to run a complete working exampleStart with the Quickstart Guide
3

Choose Your SDK

Implement workflows in your preferred language:

Client SDKs

Cadence provides official client libraries for implementing workflows:

Go SDK

Official Cadence Go client for building workflow workers

Java SDK

Official Cadence Java client for building workflow workers
Community-contributed SDKs are also available for Python and Ruby.

Community and Support

Join the Cadence community:

Learn More

Quickstart

Run your first Cadence workflow in minutes

Installation

Set up Cadence in your environment

Architecture

Deep dive into Cadence’s architecture

Concepts

Understand workflows, activities, and more
This is an introduction to Cadence. For production deployments, please review the Operation Guide for best practices and configuration recommendations.

Build docs developers (and LLMs) love