Quickstart
This guide will help you run your first Cadence workflow in minutes. You’ll start a local Cadence server using Docker Compose, register a domain, and execute a sample workflow.Prerequisites
Make sure you have the following installed on your system:
- Docker (version 20.10 or later)
- Docker Compose (version 2.0 or later)
- Git
Step 1: Start Cadence Server
The easiest way to run Cadence locally is using Docker Compose. This will start all required services including Cadence server, Cassandra database, and the Web UI.Start the services
The first time you run this command, Docker will download all required images. This may take a few minutes.
Verify the services are running
The following services are now available:
| Service | URL | Description |
|---|---|---|
| Cadence Frontend | localhost:7933 (TChannel) | API endpoint |
| Cadence Frontend | localhost:7833 (gRPC) | API endpoint |
| Cadence Web UI | http://localhost:8088 | Web interface |
| Grafana | http://localhost:3000 | Metrics dashboard |
| Prometheus | http://localhost:9090 | Metrics storage |
Using Alternative Databases
The default setup uses Cassandra. You can use MySQL or PostgreSQL instead:Step 2: Access the Web UI
Open your browser and navigate to http://localhost:8088 to access the Cadence Web UI.The Cadence Web UI provides a visual interface for monitoring workflows, viewing execution history, and querying workflow state.
The Web UI allows you to:
- View workflow execution history
- Query workflows by various filters
- Inspect workflow details and event history
- Monitor running and completed workflows
Step 3: Install Cadence CLI
The Cadence CLI is used to interact with the Cadence server, register domains, and manage workflows.Step 4: Register a Domain
Domains are a logical grouping of workflows and activities. You must register a domain before running any workflows.Step 5: Run Your First Workflow
Now let’s run a sample workflow. Choose your preferred language:- Go
- Java
Start a worker
Workers execute your workflow and activity code. Start the helloworld worker:You should see output indicating the worker has started:
Understanding the Code
Here’s the helloworld workflow implementation:- Defines activity execution options (timeouts)
- Executes an activity asynchronously
- Waits for the result
- Returns the greeting
Step 6: View Workflow in Web UI
Go back to the Cadence Web UI at http://localhost:8088 to see your workflow execution.The workflow execution history shows all events, activity results, and the complete execution timeline.
Next Steps
Congratulations! You’ve successfully run your first Cadence workflow. Here’s what to explore next:Explore More Samples
Try more complex workflow patterns and examples
Learn Core Concepts
Understand workflows, activities, and task lists
Production Setup
Set up Cadence for production use
CLI Reference
Master the Cadence command-line interface
Troubleshooting
Docker containers won't start
Docker containers won't start
Make sure ports 7933, 7833, 8088, and 9042 are not already in use:Stop the containers and remove volumes to start fresh:
Worker can't connect to Cadence
Worker can't connect to Cadence
Verify the Cadence frontend is running:Check that port 7933 (TChannel) or 7833 (gRPC) is accessible:
Domain registration fails
Domain registration fails
Ensure the Cadence server is fully started (wait 30-60 seconds after
docker compose up).Check Cadence server logs:Web UI shows no workflows
Web UI shows no workflows
Make sure you’ve selected the correct domain (
samples-domain) from the dropdown menu.Verify workflows were actually executed by checking worker logs.