Skip to content

Loops guide · 2 of 8

Build your first Loop

Turn a sample support request into a short internal summary with two Loop AI steps, then test it.

Start small. Your first Loop should take one piece of text and turn it into something useful. Once that works, add the next step.

In this tutorial you build a Loop that reads a support request and writes a short internal summary for your team. It uses two Loop AI steps. Both steps only work with text. They need no linked agent, never contact another system, and never send email.

Time: about 15 minutes. You need: owner or admin access to an organization in raia Command.

What you will build

StepKindWhat it does
1. Extract the factsLoop AIPulls out the issue, the business impact, and what is missing from the request.
2. Write the internal summaryLoop AITurns those facts into a short internal summary with one next action.

The request you will test with is fictional:

text
Our invoice export stops at 80%. It started this morning. Three people on our finance team are blocked. We have not tried another browser yet.

Part 1 — Create the Loop

  1. Sign in at raiacommand.com and choose the organization you want to work in. Then, in the sidebar, click Loops.
  2. Click New Loop. raia Command creates an empty draft and opens it straight away. There is no dialog, and the draft starts Paused.
New Loop opens an empty draft straight away. There is no dialog, and it starts Paused.
  1. Highlight 1: The pencil next to the name lets you edit the name and purpose.
  2. Highlight 2: Paused: the new draft can't be started by a trigger.
  3. Highlight 3: No steps yet. You add them in Part 2.
  1. Click the pencil next to Untitled Loop.
  2. Type a clear name, such as Support request summary. In What does this Loop achieve?, add a short purpose — for example, "Text only, no emails or external actions."
  3. Click Save.
Editing the name and purpose in place. Nothing is kept until you click Save.
  1. Highlight 1: Type the Loop's name.
  2. Highlight 2: What does this Loop achieve? Add a short purpose.
  3. Highlight 3: Click Save.
  1. Stay on the Steps tab.

Why not Build with AI? Build with AI drafts a Loop from a description. It is useful later. For your first Loop, building by hand shows you how each part works.

Part 2 — Add step 1: extract the facts

  1. Click Edit Steps.
Stay on the Steps tab and click Edit Steps to add or change steps.
  1. Highlight 1: The Steps tab is selected.
  2. Highlight 2: Click Edit Steps.
  1. Click Add Loop AI. The add buttons sit at the end of the step list.
Step-type add buttons in edit mode.
  1. Highlight 1: Click Add Loop AI.
  2. Highlight 2: Add step adds an agent step. You don't need it here.
  3. Highlight 3: Add approval adds a step where a person decides.
Save steps in the draft editor toolbar.
  1. Highlight 1: Save steps keeps your changes later.
  1. In Title, type Extract the facts. Kind is already Loop AI processes the result.
The new step's Title, Kind and Prompt fields.
  1. Highlight 1: Title: Extract the facts
  2. Highlight 2: Kind is already Loop AI processes the result.
  3. Highlight 3: Prompt: paste the step 1 prompt here.
Context and optional named-result fields, with the draft save control.
  1. Highlight 1: What it can see: Just the previous step.
  2. Highlight 2: Named results (optional): leave empty.
  3. Highlight 3: Save steps keeps the step.
  1. In Prompt, paste:
text
Read the support request in the Run objective. Extract the issue, business impact, and missing information. Use only stated facts. Do not invent a cause or claim the problem is fixed. Return three headings: Issue, Impact, Missing information.
  1. In What it can see, choose Just the previous step. For the first step, that is the Run objective.
  2. Leave Named results (optional) empty. This Loop does not need them.
Prompt and the open context menu.
  1. Highlight 1: Prompt: the step 1 prompt, pasted in.
  2. Highlight 2: What it can see: open the menu.
  3. Highlight 3: Choose Just the previous step.
Optional named-result field.
  1. Highlight 1: Named results (optional): leave empty.

Why "use only stated facts"? A Loop AI step may produce details that were not in its input. Tell it what evidence to use, then inspect its output. Telling it not to invent a cause or a fix keeps the summary honest.

Part 3 — Add step 2: write the summary

  1. Click Add Loop AI again. The new step appears below step 1.
  2. Name it Write the internal summary.
  3. In Prompt, paste:
text
Use the facts from the previous step to write a short internal support summary. Include the issue, who is affected, and one sensible next action. Keep it under 120 words. Clearly label missing information. Do not invent a fix. Do not send a message or change any system.
  1. In What it can see, choose Just the previous step.
Step identity and prompt fields.
  1. Highlight 1: Title: Write the internal summary
  2. Highlight 2: Kind: Loop AI processes the result
  3. Highlight 3: Prompt: paste the step 2 prompt.
Context and optional named-result fields.
  1. Highlight 1: What it can see: Just the previous step
  2. Highlight 2: Named results (optional): leave empty.
  1. Click Save steps.

Saving stores the draft. It does not publish anything, and nothing runs yet.

Optimize

Each prompt has an Optimize option that suggests a revision. Read the suggestion, then click Use suggestion or Discard. Nothing changes until you choose, and you still need to save.

Part 4 — Set small safety limits

Limits stop a Run that goes further than you expect. This Loop is small, so its limits can be small too.

  1. Click the Safety tab.
  2. Enter:
  • Max steps per run: 4
  • Token cap per run: 10000
  • Deadline (seconds): 300
  • Max external actions per run: 1 (not 0)
Safety section, step limit and token cap.
  1. Highlight 1: The Safety tab.
  2. Highlight 2: Max steps per run: 4
  3. Highlight 3: Token cap per run: 10000
Deadline, external-action limit and draft save control.
  1. Highlight 1: Deadline (seconds): 300
  2. Highlight 2: Max external actions per run: 1 (not 0)
  3. Highlight 3: Click Save limits.
  1. Click Save limits.
Save limits stores the limits on the draft.
  1. Highlight 1: Click Save limits.

Why 1 external action, if this Loop has none? The cap is a ceiling, not a plan. Setting it to 1 does not add an action, and neither step will ever use it. Do not set it to 0: today, a limit of 0 stops the Run before step 1, even for a text-only Loop. See Runs and troubleshooting.

Part 5 — Describe what "done" means (optional)

  1. Click the Outcome tab.
  2. Leave Results that must be present empty — this Loop returns no named results.
  3. In In your own words (optional), paste:
text
The final summary uses only facts from this Run's objective. It describes the issue and any stated impact, clearly labels missing information, gives one sensible next action, stays under 120 words, and does not invent a cause or claim a fix.
This saved example criterion was written for the invoice-export sample only. For a reusable Loop, use the general wording in the text.
  1. Highlight 1: In your own words (optional): the plain-language check.
  2. Highlight 2: It is judged by AI against everything the Run produced.
  1. Click Save definition of done.
Save definition of done is under the text box. (The criterion shown was written for the invoice sample only.)
  1. Highlight 1: In your own words (optional): paste the general criterion.
  2. Highlight 2: Click Save definition of done.

This wording works for any request, so you can change the test input without editing the outcome. It does not check the specific facts of each sample — you compare those yourself in the Journey (Part 7).

Part 6 — Test the Loop

  1. Click Run test in the Loop header.
Run test is in the Loop header, next to Run this Loop.
  1. Highlight 1: Click Run test.

The window that opens says it uses the draft you are editing, not the published version.

  1. In Prompt to Trigger the Loop, paste the sample request. This becomes the Run objective.
Paste the sample request here. It becomes the Run objective.
  1. Highlight 1: Prompt to Trigger the Loop
  1. Check the safety limits shown in the window match what you saved.
  2. Click Start run.
Check the limits, then start the test Run.
  1. Highlight 1: The limits this Run will use.
  2. Highlight 2: Click Start run.

Run test really runs your draft. This example's two Loop AI steps do not send messages or change external systems. A test Run still uses tokens. In other Loops, Run test can perform configured external actions. Run a few focused tests.

Part 7 — Check the result

Open the test Run and look at the Journey. It shows each step in order. Click a step to show its full output.

In the Journey, open each step to read what it produced.
  1. Highlight 1: A step in the Journey. Click it to show or hide its output.
  2. Highlight 2: Step 2's output. Compare it with the facts in the request.

Step 1 should find these facts:

  • Issue: the invoice export stops at 80%.
  • Impact: three people on the finance team are blocked. It started this morning.
  • Missing information: for example, which browser and file format they use, whether there is an error message, and whether it fails for everyone. The request also says they have not tried another browser.

Step 2 should give a short summary that:

  1. states the issue, when it started, and who is blocked,
  2. says "They have not tried another browser yet." — and nothing broader about what was tried,
  3. labels missing information clearly,
  4. gives exactly one next action — such as asking the customer to try another browser and share any error message,
  5. does not claim a cause or a fix, and stays under 120 words.

Your wording will differ from run to run. That is fine. If step 2 adds anything that is not in the request, tighten the prompt and test again.

The Run summary shows usage against each limit.
  1. Highlight 1: Tokens used, Steps taken and External actions taken, each against its limit.
  2. Highlight 2: Loop version: Draft (test run).

In the Run summary, check that both steps finished, usage stayed within your limits, and External actions taken is 0.

Then check the outcome verdict. It is judged by AI and may not pass every Run — treat it as a second opinion, not a status change. If it says text is missing or cut off, expand the step in the Journey and compare its full output before changing anything. If it still disagrees with your own reading, you can simplify or remove the outcome check.

Checkpoint

You have a saved draft Loop with two text-only steps, small safety limits, and a test Run whose Journey shows both steps and the facts above.

What not to do yet

  • Do not add triggers. Keep starting Runs by hand until the Loop behaves well with several different requests.
  • Do not add steps that send email or create records. You will learn how to control those in Approvals and external actions.

Try it with more data

Test with two or three more requests before you trust the Loop. Use one that is very short, and one that contains no clear impact:

text
Login is slow.
text
Hi, we were charged twice this month for the same plan. Can someone look at it? Thanks, the team at a small bakery.

For the first, step 1 should list almost everything as missing information. That is the correct result.