This project demonstrates a Temporal workflow for a shopping cart application. It illustrates how Temporal can be used to orchestrate complex workflows in a distributed system.
- Docker and Docker Compose
- .NET SDK
- Visual Studio
To run the Temporal server locally, you can use Docker Compose. (There are other ways to run the development environment locally)
-
Clone the Temporal Docker Compose repository:
git clone https://github.com/temporalio/docker-compose.git cd docker-compose
-
Start the Temporal server:
docker-compose up
This command starts the Temporal server and its dependencies (such as Cassandra or MySQL, depending on the configuration).
-
Creating an Alias for Temporal CLI in PowerShell
To simplify the usage of the Temporal CLI within the Docker container, you can create an alias in PowerShell. This alias allows you to run Temporal CLI commands without typing the full Docker command each time.
-
Open PowerShell:
Start PowerShell on your machine.
-
Define the Alias:
Run the following command in PowerShell to create an alias named
TemporalCli
:function TemporalCli { docker exec -it temporal-admin-tools temporal $args } Set-Alias -Name tctl -Value TemporalCli
This command creates a function
TemporalCli
that runs Temporal CLI commands inside the Docker container (temporal-admin-tools
). TheSet-Alias
command then creates an aliastctl
that points to this function. -
Using the Alias:
Now, you can use the
tctl
alias in PowerShell to run Temporal CLI commands. For example:tctl namespace list
This command will list all Temporal namespaces using the Temporal CLI within the Docker container.
-
Making the Alias Persistent (Optional):
If you want this alias to be available in all future PowerShell sessions:
-
Open your PowerShell profile script:
notepad $PROFILE
-
Add the function and alias commands to this script:
function TemporalCli { docker exec -it temporal-admin-tools temporal $args } Set-Alias -Name tctl -Value TemporalCli
-
Save the file and restart PowerShell.
-
The Temporal Web UI provides a visual interface to view workflow histories, see running workflows, and query workflow data.
-
Access the Temporal Web UI:
The Temporal Web UI can be accessed at
http://localhost:8088
. -
Navigate to the Dashboard:
In the Temporal Web UI, you can navigate to the dashboard to view a list of namespaces and workflows.
-
View Workflow Details:
Click on a specific workflow to view its details, history, and events. This is useful for debugging and understanding the behavior of your workflows.
This README provides basic instructions to get started with the Temporal workflow demo. For more detailed information about Temporal and its capabilities, visit the Temporal Documentation, to Temporal DotNet specific documentation, visit the SDK Temporal DotNet SDK