Skip to main content

Introduction

The Cadence Python client is an async Python SDK for building workflows and activities, connecting to the Cadence server over gRPC.

Installation

pip install cadence-python-client

Packages

cadence.client

Client connects to the Cadence frontend, starts and signals workflows, and manages schedules.

cadence.worker

Worker polls the server for workflow and activity tasks. Registry holds workflow and activity definitions.

cadence.workflow

Decorators and functions for defining workflow logic: @workflow.run, @workflow.signal, @workflow.query, execute_activity, execute_child_workflow, sleep, continue_as_new, and more.

cadence.activity

Decorators for defining activities: @activity.defn, @activity.method. Context functions: activity.heartbeat(), activity.info().

cadence.testing

TestWorkflowEnvironment runs workflows in-memory for unit tests without a Cadence server.

Feature coverage

FeatureSupported
Workers and task listsYes
Workflow definition and registrationYes
Starting, signaling, querying, cancelling workflowsYes
Activities with retry and heartbeatYes
Child workflowsYes
Signals (inbound and outbound)Yes
QueriesYes
Retry policiesYes
Continue-as-newYes
Sleep and wait conditionsYes
Distributed cronYes
SchedulesYes
In-memory workflow testingYes
Workflow versioning (get_version)Not yet
Side effectsNot yet
Activity async completionNot yet
SessionsNot yet