Skip to content

kevinmichaelchen/temporal-saga-grpc

Repository files navigation

temporal-saga-grpc

Lines Of Code

./docs/public/diagrams/architecture.svg

This project demonstrates using Temporal to orchestrate a saga (effectively a distributed transaction) that interacts with multiple services and has a robust, edge-case-proof rollback strategy, as well as durable function execution. Temporal abstracts away failures.

Getting started

Step 1: Spin everything up

You can spin everything up with:

make

Note

Under the hood, we use a bunch of tools (which you can read about here), but to run things seamlessly locally, the one tool you will need is pkgx.

Step 2: Observe the workflow

Let's get ready to observe this thing in action!

Step 3: Start a Temporal Workflow

curl -v http://localhost:8081/temporal.v1beta1.TemporalService/CreateOnboardingWorkflow \
  -H "Content-Type: application/json" \
  --data-binary @- <<EOF
  {
    "license": {
      "start": "2023-11-16T12:00:00Z",
      "end": "2024-01-16T12:00:00Z"
    },
    "org": {
      "name": "Org 1"
    },
    "profile": {
      "full_name": "Kevin Chen"
    }
  }
EOF