https://github.com/korniichuk/temporal-python-summit-2024
Temporal: Bulletproof Workflows
https://github.com/korniichuk/temporal-python-summit-2024
Last synced: 6 months ago
JSON representation
Temporal: Bulletproof Workflows
- Host: GitHub
- URL: https://github.com/korniichuk/temporal-python-summit-2024
- Owner: korniichuk
- License: unlicense
- Created: 2024-12-08T22:04:23.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T22:45:14.000Z (10 months ago)
- Last Synced: 2025-02-13T04:30:27.104Z (8 months ago)
- Language: Python
- Size: 237 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Temporal: Bulletproof Workflows
## Step 1/4: Installation
### Install Temporal CLI
To install the Temporal CLI, download the version for your architecture:
- [Download Temporal CLI for Linux amd64](https://temporal.download/cli/archive/latest?platform=linux&arch=amd64)
- [Download Temporal CLI for Linux arm64](https://temporal.download/cli/archive/latest?platform=linux&arch=arm64)For example: `temporal_cli_1.1.2_linux_amd64.tar.gz` file.
Extract the downloaded archive. Example:
```sh
$ 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:
```sh
$ mv temporal /usr/local/bin/
```
### Install Temporal SDK
Install the Temporal Python SDK:
```sh
$ pip install temporalio
```## Step 2/4: Start Temporal Server
Open a new terminal window and run the following command:
```sh
$ temporal server start-dev
```This command starts a local Temporal Server. It starts the Web UI, creates the `default` [Namespace](https://docs.temporal.io/namespaces?_gl=1*c6vqdb*_gcl_au*MTIwMzc0ODY4OC4xNzMzMjU2NDU0*_ga*MTY3NTk4Mzk3MC4xNzMzMjU2NDU0*_ga_R90Q9SJD3D*MTczMzY5MjczMy45LjEuMTczMzY5MzM1My4wLjAuMA..), 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`.
## Step 3/4: Start Temporal Worker
Open a new terminal window and run the following command:
```sh
$ python3 worker.py
```
Leave the Temporal Worker running.## Step 4/4: Execute Temporal Workflow
Open a new terminal window and run the following command:
```sh
$ python3 app.py
```Example output:
```sh
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:
## Sources
- [Set up a local Temporal Service for development with Temporal CLI](https://learn.temporal.io/getting_started/python/dev_environment/?os=linux#set-up-a-local-temporal-development-cluster)