Exercise: Hello World API
Build a minimal saga on Train RPC that returns {message: "Hello World"}.
Before you start
What you’ll build
Troubleshooting
Last updated
Build a minimal saga on Train RPC that returns {message: "Hello World"}.
This exercise creates a tiny saga and exposes it as an API endpoint. You will run it through the Train RPC runner. The flow uses only three steps: Start → Transform → Success.
You can access the Devops app and the Saga screen.
The training deployment (including train_rpc) is installed and running.
You know your API base URL: https://[YOUR_ADMIN_API_DOMAIN].
Saga path: /HelloWorld
Runner: train_rpc (via Allowed For: Train RPC)
Response: HTTP 200 with body {message: "Hello World"}
Click the pencil next to ID: and set a unique identifier.
For this exercise, use: hello_world-0001.

IDs can be auto-generated if an ID generator is configured. For core assets like sagas and queries, human-readable IDs make debugging and audits much easier.
If you assign IDs manually, prefer alphanumerics plus - and _. For high-volume assets, consider a 4‑digit partition suffix (like -0001). For low-volume assets, you can skip partitioning.
Click the Definition icon (circled edit icon) to open saga metadata.

Fill in these fields:

Saga Name: Hello World
Saga Domain (optional): util
Status: ACTIVE
Saga Description (optional): Returns "Hello World"
Saga Path: /HelloWorld
Version: 0
Allowed For: Train RPC
Auto Fail: true
This means requests to /HelloWorld routed through train_rpc will execute this saga.
Allowed For limits which runner can execute the saga. Leaving it empty allows any runner to execute it.
The flow runs now, but it does not yet return "Hello World". You’ll add a static value to the payload.
Select the Transform step. Click its pencil icon to edit.

Set these values:

Step Name: Say Hello World
Step Description (optional): This step adds a static "Hello World" message.
Transform Class: Add Value to Payload
Transform Parameters:
Key: value
Value: {message: "Hello World"}
Click Apply to save the step configuration.
Why does Transform have a “Class”?
Instead of adding a separate stencil shape for every transformation type, the step stays the same. You switch behavior by selecting a different Class (or Action) in the step config.
This makes it safer to evolve flows over time. You can change behavior without rebuilding the graph and breaking tracing continuity.
The step label should update on the canvas:

404 Not Found: confirm Saga Path and that you saved the saga. Also confirm it’s allowed for Train RPC.
403/401: gateway auth is blocking the request. Check your token/session.
Saga does not trigger: confirm the request is routed through train_rpc (URL contains /train_rpc/).
Last updated







