Demonstrates a simple Money Transfer in Temporal implemented in different languages.
The workflow is designed so that the "Happy Path" is one workflow and all other scenarios are implemented using a Dyanmic Workflow.
Scenarios currently implemented include
- Happy Path - everything works as intended
- Advanced Visibility - updates a Search Attribute (Step) as it progesses through the workflow
- Require Human in the Loop - Shows how to use a signal with timeouts if not approved in time
- API Downtime - Demonstrates an unreliable API (recovers after the 5th attempt)
- Bug in Workflow - Purposefully throws/raises an error (fix and redeploy the worker)
- Invalid Account - How to exit a workflow for business purposes (fail the workflow)
Start Temporal Locally
temporal server start-dev
Create a Search Attribute
temporal operator search-attribute create --name Step --type Keyword
Next, start the UX which is written using the Java SDK
cd ui
./startlocalwebui.sh
Navigate to http://localhost:7000 in a web browser to interact with the UX
Now start a worker. You can choose to use the Java, Go or .NET Worker below
In a new terminal, start the Java Worker
cd java
./startlocalworker.sh
In a new terminal, start the Golang Worker
cd go
./startlocalworker.sh
In a new terminal, start the .NET Worker
cd dotnet
./startlocalworker.sh
In a new terminal, start the Python Worker
cd python
# if you haven't done this yet, install the dependencies
poetry install
./startlocalworker.sh
Set up a search attribute in your namespace using the following command
tcld login
tcld namespace search-attributes add --namespace <namespace>.<accountId> --search-attribute "Step=Keyword"
Copy the setcloundenv.example to setcloudenv.sh
cp setcloudenv.example setcloudenv.sh
Edit setcloudenv.sh to match your Temporal Cloud account:
export TEMPORAL_ADDRESS=<namespace>.<accountID>.tmprl.cloud:7233
export TEMPORAL_NAMESPACE=<namespace>.<accountID>
export TEMPORAL_CERT_PATH="/path/to/cert.pem"
export TEMPORAL_KEY_PATH="/path/to/key.key"
Next, start the UX which is written using the Java SDK
cd ui
./startcloudwebui.sh
Now start a worker. You can choose to use the Java, Go or .NET Worker below
In a new terminal, start the Java Worker
cd java
./startcloudworker.sh
In a new terminal, start the Golang Worker
cd go
./startcloudworker.sh
In a new terminal, start the .NET Worker
cd dotnet
./startcloudworker.sh
In a new terminal, start the Python Worker
cd python
# if you haven't done this yet, install the dependencies
poetry install
./startcloudworker.sh
This demo supports encyrption by setting the environment variable ENCRYPT_PAYLOADS to true. To make this easier, each of the start*.sh files will use the first parameter to set this variable. If you want to use encryption, be sure to set this for the UI and the worker that you choose. For example:
Next, start the UX which is written using the Java SDK
cd ui
./startcloudwebui.sh true
In a new terminal, start the Java Worker
cd java
./startcloudworker.sh true
To view the decrypted data in your browser, you can set the Codec Server to use https://codec.tmprl-demo.cloud. Be sure to enable the "Pass the user access token" slider. This will work as long as you do not change the encryption key.