Run Temporal's quickstart on Catalyst
Temporal's getting-started tutorial builds a money transfer application: a workflow that withdraws money from one account and deposits it in another. This guide runs that application on Catalyst. You don't change its code. You only point it at a Catalyst App instead of a local Temporal server.
Temporal workflows on Catalyst are in preview.
Prerequisites
- The Diagrid CLI, logged in with
diagrid login. - On macOS and Linux,
jq. - Python 3.10 or later, or Go 1.23 or later.
- Optional: the Temporal CLI, to check on the workflow.
You don't need a Temporal server.
1. Create a Temporal App
Create a project with managed workflows and an App that uses the Temporal workflow API:
diagrid project create temporal-quickstart --enable-managed-workflow --use
diagrid app create money-transfer --workflow-api temporal --wait
The App's name, money-transfer, is the Temporal namespace the sample uses.
2. Get the sample
- Python
- Go
git clone https://github.com/temporalio/money-transfer-project-template-python
cd money-transfer-project-template-python
python3 -m venv env
source env/bin/activate
python -m pip install "temporalio>=1.18.1"
On Windows, activate the virtual environment with env\Scripts\activate.
git clone https://github.com/temporalio/money-transfer-project-template-go
cd money-transfer-project-template-go
3. Point the sample at Catalyst
The sample reads Temporal's standard connection settings from the environment. Set them in each terminal you use for the next steps:
- macOS/Linux
- Windows
export TEMPORAL_ADDRESS="$(diagrid project get temporal-quickstart -o json | jq -r '.status.endpoints.grpc | "\(.host):\(.port)"')"
export TEMPORAL_NAMESPACE=money-transfer
export TEMPORAL_API_KEY="$(diagrid appid get money-transfer -o json | jq -r .status.apiToken)"
$grpc = (diagrid project get temporal-quickstart -o json | ConvertFrom-Json).status.endpoints.grpc
$env:TEMPORAL_ADDRESS = "$($grpc.host):$($grpc.port)"
$env:TEMPORAL_NAMESPACE = "money-transfer"
$env:TEMPORAL_API_KEY = (diagrid appid get money-transfer -o json | ConvertFrom-Json).status.apiToken
With these set, the sample connects to Catalyst over TLS with the App's API token, instead of to localhost:7233.
4. Start the worker
The worker runs the workflow and activity code. Start it and leave it running:
- Python
- Go
python run_worker.py
go run worker/main.go
5. Start a transfer
In a second terminal, set the connection settings again, then start the workflow:
- Python
- Go
source env/bin/activate
python run_workflow.py
The sample prints the result when the workflow completes:
Result: Transfer complete (transaction IDs: W-..., D-...)
go run start/main.go
The sample prints the result when the workflow completes:
Transfer complete (transaction IDs: W..., D...)
6. See the workflow
The workflow ran on Catalyst. List it with the Temporal CLI, which reads the same connection settings:
temporal workflow list
temporal workflow show --workflow-id pay-invoice-701
You can also find it in the workflows view of the Catalyst console, or with diagrid workflow list.
To see Temporal's retries at work, follow the rest of Temporal's Python or Go tutorial. Its steps run the same way on Catalyst. Catalyst has no Temporal Web UI, so use the Temporal CLI or the Catalyst console where the tutorial uses the Web UI.
Clean up
Stop the worker with Ctrl+C, then delete the project:
diagrid project delete temporal-quickstart
Next steps
- Temporal workflows on Catalyst: connect your own application.
- Temporal compatibility: what works, what isn't available yet, and where Catalyst behaves differently.