Welcome to the Cadence Samples repository! This collection demonstrates the powerful capabilities of Cadence workflow orchestration through practical, real-world examples. Whether you're new to Cadence or looking to implement specific patterns, these samples will help you understand how to build reliable, scalable, and maintainable workflow applications.
Cadence is a distributed, scalable, durable, and highly available orchestration engine that helps developers build reliable applications. It provides:
Learn more about Cadence at:
git clone https://github.com/uber-common/cadence-samples.git && cd cadence-samples
curl -LO https://raw.githubusercontent.com/cadence-workflow/cadence/refs/heads/master/docker/docker-compose.yml && docker-compose up --wait
This downloads and starts all required dependencies including Cadence server, database, and Cadence Web UI. You can view your sample workflows at http://localhost:8088.
make
The docker-compose command requires Docker daemon to be running. On macOS/Windows, open Docker Desktop. On Linux, run sudo systemctl start docker.
If you see Bind for 0.0.0.0:<port> failed: port is already allocated, find the process using that port:
lsof -i tcp:<port>
To find which container is using it:
docker ps --format '{{.ID}}\t{{.Ports}}\t{{.Names}}' | grep <port>
Stop and remove the conflicting container:
docker stop <container_id> && docker rm <container_id>
Cadence uses these ports: 7833, 7933, 7939, 8000-8003, 8088 (Web UI), 9042 (Cassandra), 9090 (Prometheus), 3000 (Grafana).
docker-compose down
docker ps -a # check for leftover containers
docker rm <container_id> # remove if needed
Verify with docker ps and visit http://localhost:8088.
Start Worker:
./bin/helloworld -m worker
Start Workflow:
./bin/helloworld -m trigger
Start Worker:
./bin/greetings -m worker
Start Workflow:
./bin/greetings -m trigger
Start Worker:
./bin/cron -m worker
Start Workflow:
./bin/cron -m trigger -cron "* * * * *" # Run every minute
Start Worker:
./bin/timer -m worker
Start Workflow:
./bin/timer -m trigger
Start Worker:
./bin/delaystart -m worker
Start Workflow:
./bin/delaystart -m trigger
Start Worker:
./bin/branch -m worker
Start Single Branch Workflow:
./bin/branch -m trigger -c branch
Start Parallel Branch Workflow:
./bin/branch -m trigger -c parallel
Start Worker:
./bin/splitmerge -m worker
Start Workflow:
./bin/splitmerge -m trigger
Start Worker:
./bin/pickfirst -m worker
Start Workflow:
./bin/pickfirst -m trigger
Start Worker:
./bin/choice -m worker
Start Single Choice Workflow:
./bin/choice -m trigger -c single
Start Multi-Choice Workflow:
./bin/choice -m trigger -c multi
Start Worker:
./bin/retryactivity -m worker
Start Workflow:
./bin/retryactivity -m trigger
Start Worker:
./bin/cancelactivity -m worker
Start Workflow:
./bin/cancelactivity -m trigger
Cancel Workflow:
./bin/cancelactivity -m cancel -w <WorkflowID>
Start Worker:
./bin/childworkflow -m worker
Start Workflow:
./bin/childworkflow -m trigger
Start Worker:
./bin/dynamic -m worker
Start Workflow:
./bin/dynamic -m trigger
Start Worker:
./bin/tracing -m worker
Start Workflow:
./bin/tracing -m trigger
Start Workflow:
./bin/sideeffect
make
# Run all tests
go test ./...
# Run specific sample tests
go test ./cmd/samples/recipes/helloworld/
Most samples support these modes:
worker: Start a worker to handle workflow executiontrigger: Start a new workflow executionquery: Query a running workflow (where applicable)signal: Send a signal to a workflow (where applicable)We welcome contributions! Please see our Contributing Guide for details.
Apache 2.0 License - see LICENSE for details.
Happy Workflowing! π
31 followers Β· starred Feb 2025
8 followers Β· starred Apr 2026
2 followers Β· starred May 2025
Go
89.5%
Python
8.4%
Makefile
1.0%
Welcome to the Cadence Samples repository! This collection demonstrates the powerful capabilities of Cadence workflow orchestration through practical, real-world examples. Whether you're new to Cadence or looking to implement specific patterns, these samples will help you understand how to build reliable, scalable, and maintainable workflow applications.
Cadence is a distributed, scalable, durable, and highly available orchestration engine that helps developers build reliable applications. It provides:
Learn more about Cadence at:
git clone https://github.com/uber-common/cadence-samples.git && cd cadence-samples
curl -LO https://raw.githubusercontent.com/cadence-workflow/cadence/refs/heads/master/docker/docker-compose.yml && docker-compose up --wait
This downloads and starts all required dependencies including Cadence server, database, and Cadence Web UI. You can view your sample workflows at http://localhost:8088.
make
The docker-compose command requires Docker daemon to be running. On macOS/Windows, open Docker Desktop. On Linux, run sudo systemctl start docker.
If you see Bind for 0.0.0.0:<port> failed: port is already allocated, find the process using that port:
lsof -i tcp:<port>
To find which container is using it:
docker ps --format '{{.ID}}\t{{.Ports}}\t{{.Names}}' | grep <port>
Stop and remove the conflicting container:
docker stop <container_id> && docker rm <container_id>
Cadence uses these ports: 7833, 7933, 7939, 8000-8003, 8088 (Web UI), 9042 (Cassandra), 9090 (Prometheus), 3000 (Grafana).
docker-compose down
docker ps -a # check for leftover containers
docker rm <container_id> # remove if needed
Verify with docker ps and visit http://localhost:8088.
Start Worker:
./bin/helloworld -m worker
Start Workflow:
./bin/helloworld -m trigger
Start Worker:
./bin/greetings -m worker
Start Workflow:
./bin/greetings -m trigger
Start Worker:
./bin/cron -m worker
Start Workflow:
./bin/cron -m trigger -cron "* * * * *" # Run every minute
Start Worker:
./bin/timer -m worker
Start Workflow:
./bin/timer -m trigger
Start Worker:
./bin/delaystart -m worker
Start Workflow:
./bin/delaystart -m trigger
Start Worker:
./bin/branch -m worker
Start Single Branch Workflow:
./bin/branch -m trigger -c branch
Start Parallel Branch Workflow:
./bin/branch -m trigger -c parallel
Start Worker:
./bin/splitmerge -m worker
Start Workflow:
./bin/splitmerge -m trigger
Start Worker:
./bin/pickfirst -m worker
Start Workflow:
./bin/pickfirst -m trigger
Start Worker:
./bin/choice -m worker
Start Single Choice Workflow:
./bin/choice -m trigger -c single
Start Multi-Choice Workflow:
./bin/choice -m trigger -c multi
Start Worker:
./bin/retryactivity -m worker
Start Workflow:
./bin/retryactivity -m trigger
Start Worker:
./bin/cancelactivity -m worker
Start Workflow:
./bin/cancelactivity -m trigger
Cancel Workflow:
./bin/cancelactivity -m cancel -w <WorkflowID>
Start Worker:
./bin/childworkflow -m worker
Start Workflow:
./bin/childworkflow -m trigger
Start Worker:
./bin/dynamic -m worker
Start Workflow:
./bin/dynamic -m trigger
Start Worker:
./bin/tracing -m worker
Start Workflow:
./bin/tracing -m trigger
Start Workflow:
./bin/sideeffect
make
# Run all tests
go test ./...
# Run specific sample tests
go test ./cmd/samples/recipes/helloworld/
Most samples support these modes:
worker: Start a worker to handle workflow executiontrigger: Start a new workflow executionquery: Query a running workflow (where applicable)signal: Send a signal to a workflow (where applicable)We welcome contributions! Please see our Contributing Guide for details.
Apache 2.0 License - see LICENSE for details.
Happy Workflowing! π
31 followers Β· starred Feb 2025
8 followers Β· starred Apr 2026
2 followers Β· starred May 2025
Go
89.5%
Python
8.4%
Makefile
1.0%