A good step does one job. When each step has a small, clear task, Runs are easier to test and easier to fix.
Choose the step kind
When you click Edit Steps, you can add three kinds of step:
| Choice | Pick it when |
|---|---|
| Add step (agent) | The work needs one of your raia agents — its knowledge, skills, or tools. |
| Add Loop AI — "Loop AI processes the result" | You need to extract, summarize, rewrite, score, or decide from text you already have. |
| Add approval — "A person decides" | A human must check the work before it continues. |
Start with Loop AI when you can. It is the simplest, and it does not reach outside raia Command.
Agent steps
An agent step sends a task to one of your agents.
- Click Add step.
- Choose a working agent. The agent must already be set up and working.
- Write the Task: what the agent should do in this step only.
Write the task like an instruction to a colleague:
Look up our refund policy and say whether the request in the previous step qualifies for a refund. Answer "Qualifies", "Does not qualify", or "Unclear", then give one sentence explaining why.If the agent has tools that change other systems, read Approvals and external actions before you test.
Loop AI steps
A Loop AI step has three settings.
Prompt. What the step should do. Say what to read, what to produce, and what not to do.
What it can see. Either Just the previous step or Every step so far. Choose the previous step unless you need earlier results too. Limiting context can reduce irrelevant material, but include every earlier result the step needs and check its output.
Named results (optional). Labels for specific values the step should return, such as priority or category. Use them when a later rule must check a value, or when the Outcome tab must require it. Leave the field empty for plain text.
- Highlight 1: Prompt
- Highlight 2: Optimize suggests a revision you can use or discard.
- Highlight 3: What it can see
- Highlight 1: Named results (optional)
- Highlight 1: Just the previous step
- Highlight 2: Every step so far
- Highlight 3: Named results (optional): leave empty for plain text.
A prompt pattern that works
Read [what].
Produce [exact format].
Use only [allowed source].
If [edge case], then [what to do].Example:
Read the previous step.
Produce one word: Low, Medium, High, or Unclear.
Use only the impact described.
If no impact is described, answer Unclear. Do not guess.Optimize
Optimize suggests a better version of your prompt. Read it carefully. Click Use suggestion to accept it or Discard to keep yours. Then click Save steps. Saving and publishing are separate actions.
Route between steps
By default, steps run in order. Each step has a When this step finishes section where you can change that.
You can choose to:
- go to the next step,
- jump to a different step,
- move on only if a condition matches,
- stop the Run, or
- fail the Run.
Rules are checked from top to bottom. The first rule that matches is used, and the rest are ignored. Put your most specific rule first.
Example: skip work for low-priority requests
Say step 2 returns a named result called priority.
- In step 2, open When this step finishes.
- Add a rule: if
priorityequalsLow, stop the Run. - Leave the default as next step.
Now low-priority requests end after step 2. Everything else continues.
For Unclear, add a second rule that jumps to an approval step, so a person checks the request instead of the Loop guessing.
Spelling matters
Conditions compare named results exactly. If the step returns priority but your rule checks Priority, the rule does not match. A rule that checks a field the step never returned also does not match — the Run falls through to the next rule.
Checklist for every step
- Does it do one job?
- Could a new colleague follow the prompt or task without asking you?
- Does it say what to do when information is missing?
- Does it see only what it needs?
- If a rule depends on it, does it return the named result spelled exactly as the rule expects?
Checkpoint
Save, then click Run test with real-looking sample data. Open the Journey and check each step's output before you add the next one.