Exercise: Create an API Endpoint
This page lists an exercise for building 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.
Before you start
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].
What you’ll build
Saga path:
/HelloWorldRunner:
train_rpc(via Allowed For: Train RPC)Response: HTTP
200with body{message: "Hello World"}
Define the saga (name, path, allowed runner)
Click the Definition icon (circled edit icon) to open saga metadata.

Fill in these fields:

Saga Name:
Hello WorldSaga Domain (optional):
utilStatus:
ACTIVESaga Description (optional):
Returns "Hello World"Saga Path:
/HelloWorldVersion:
0Allowed For:
Train RPCAuto Fail:
true
This means requests to /HelloWorld routed through train_rpc will execute this saga.
Configure the Transform step
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 WorldStep Description (optional):
This step adds a static "Hello World" message.Transform Class:
Add Value to PayloadTransform Parameters:
Key:
valueValue:
{message: "Hello World"}
Click Apply to save the step configuration.
The step label should update on the canvas:

Troubleshooting
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








