To install the Temporal CLI, download the version for your architecture:
For example: temporal_cli_1.1.2_linux_amd64.tar.gz
file.
Extract the downloaded archive. Example:
$ tar xzf temporal_cli_1.1.2_linux_amd64.tar.gz
Add the temporal
binary to your PATH
by copying it to a directory like /usr/local/bin/
.
Example:
$ mv temporal /usr/local/bin/
Install the Temporal Python SDK:
$ pip install temporalio
Open a new terminal window and run the following command:
$ temporal server start-dev
This command starts a local Temporal Server. It starts the Web UI, creates the default
Namespace, and uses an in-memory database.
The Temporal Service will be available on localhost:7233
.
The Temporal Web UI will be available at http://localhost:8233.
Leave the local Temporal Server running. You can stop the Temporal Service at any time by pressing Ctrl+C
.
Open a new terminal window and run the following command:
$ python3 worker.py
Leave the Temporal Worker running.
Open a new terminal window and run the following command:
$ python3 app.py
Example output:
Result: Hello World!
Navigate to Temporal Web UI at http://localhost:8233 to see Temporal Workflows:
Click on example-workflow
Workflow ID to see Temporal Workflow History and Execution Result: