# 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](https://docs.diagrid.io/develop/workflows/temporal).

## Prerequisites

- The [Diagrid CLI](https://docs.diagrid.io/getting-started/local-installation#diagrid-cli), logged in with `diagrid login`.
- On macOS and Linux, [`jq`](https://jqlang.org/download/).
- Python 3.10 or later, or Go 1.23 or later.
- Optional: the [Temporal CLI](https://docs.temporal.io/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:

```bash
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**

```bash
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`.

**Go**

```bash
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**

```bash
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)"
```

**Windows**

```powershell
$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**

```bash
python run_worker.py
```

**Go**

```bash
go run worker/main.go
```

## 5. Start a transfer

In a second terminal, set the connection settings again, then start the workflow:

**Python**

```bash
source env/bin/activate
python run_workflow.py
```

The sample prints the result when the workflow completes:

```text
Result: Transfer complete (transaction IDs: W-..., D-...)
```

**Go**

```bash
go run start/main.go
```

The sample prints the result when the workflow completes:

```text
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:

```bash
temporal workflow list
temporal workflow show --workflow-id pay-invoice-701
```

You can also find it in the [workflows view](https://docs.diagrid.io/operate/project-operations/workflows) of the Catalyst console, or with [`diagrid workflow list`](https://docs.diagrid.io/references/catalyst/cli-reference/workflow).

To see Temporal's retries at work, follow the rest of Temporal's [Python](https://learn.temporal.io/getting_started/python/first_program_in_python/) or [Go](https://learn.temporal.io/getting_started/go/first_program_in_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:

```bash
diagrid project delete temporal-quickstart
```

## Next steps

- [Temporal workflows on Catalyst](https://docs.diagrid.io/develop/workflows/temporal): connect your own application.
- [Temporal compatibility](https://docs.diagrid.io/develop/workflows/temporal/compatibility): what works, what isn't available yet, and where Catalyst behaves differently.
