With Dapr Workflows, you can easily orchestrate messaging, state management, and failure-handling logic across various microservices. Dapr Workflows can help you create long-running, fault-tolerant, and stateful applications.
- Clone the sample project.
- Create an AKS cluster.
- Install the Dapr extension on your AKS cluster.
-
Make sure that Dapr is installed on the cluster. If not, run
dapr init -k
. -
Install Redis on the cluster.
helm repo add bitnami https://charts.bitnami.com/bitnami helm install redis bitnami/redis k apply -f Deploy/redis.yaml
-
Install the sample app.
k apply -f Deploy/deployment.yaml
-
Expose the Dapr sidecar (only for testing!) and the sample app.
k apply -f Deploy/service.yaml export SAMPLE_APP_URL=$(k get svc/workflows-sample -o jsonpath='{.status.loadBalancer.ingress[0].ip}') export DAPR_URL=$(k get svc/workflows-sample-dapr -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
-
Before starting the workflow, make an API call to the sample app to restock items in the inventory.
curl -X GET $SAMPLE_APP_URL/stock/restock
-
Start the workflow.
curl -i -X POST $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234/start \ -H "Content-Type: application/json" \ -d '{ "input" : {"Name": "Paperclips", "TotalCost": 99.95, "Quantity": 1}}'
-
Check the status of the workflow.
curl -i -X GET $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234