Skip to content

Solution Design Playbook

Loops and outbound

Loops and outbound

Loops are how work happens without anyone asking: on a schedule, after an event, through several steps, with people approving along the way. This page covers when and how to use them, and when outbound messaging belongs in raia Control instead.

Do you need a Loop?

If someone asks and the agent answers, you don't. Reach for a Loop when the work:

  • Starts from a schedule, a webhook or an incoming email.
  • Has several steps in a set order.
  • Branches depending on what happened.
  • Needs a person to approve something.
  • Needs a lasting record of each run.

Triggers

A Loop can start by hand, on a schedule (down to every few minutes), from a webhook, or when an email arrives. Examples include a new lead in your CRM, a conversation ending, a ticket being marked as a bug, a morning summary, or a weekly changelog.

For each trigger, decide whether two runs may overlap, give each run a clear objective, and set any trigger limits that are offered.

Three kinds of step

An agent does the work

Sends a task to a named raia cX agent, which uses its own knowledge, instructions and tools. Use it when the step needs domain knowledge, retrieval or external actions. The agent can also send an email with a recipient, subject and body built from earlier results.

The Loop AI processes the result

Reshapes, summarizes, classifies or scores what came before, with no agent involved. Use it for simple, self-contained transformations. It can't take actions in other systems.

A person decides

Pauses the run until enough named people approve or reject. A rejection can send the work back to an earlier step with feedback, so it's revised rather than abandoned.

Branches, outcomes and safety limits

Branch on named results, values, thresholds and human decisions: go to the next step, jump to a named step, finish, or fail. Define the outcome the run must produce, so success is checked rather than assumed.

Set safety limits on every Loop: caps on tokens, time, number of steps and external actions. They stop a run that goes wrong from running on.

Each run keeps a permanent history of what happened. Publishing a new version of a Loop affects new runs only, never runs already in progress.

Proof that it happened

An agent saying "done" is not evidence. When the outcome matters, design the step that proves it: a case number from the CRM, a saved record, a returned ID.

A "Send an email" step completes when the agent's email channel accepts the message. That isn't proof of delivery to an inbox. If the business needs delivery confirmed, add delivery events from your mail provider, or ask the recipient to acknowledge.
A Loop started by a webhook runs separately from the conversation that triggered it. It won't automatically report back into a live chat. If the customer needs a case number during the conversation, let the agent create the case directly with a scoped tool, or design and test a way to return the result.

Common shapes

ShapeFlow
Document every conversationConversation ends, webhook, Loop, agent creates the record
Morning digestSchedule, agent fetches and prioritizes, Loop AI formats, email step
Approved actionEvent, agent drafts, person decides, agent acts, result checked
New-lead follow-upCRM event, agent enriches, agent drafts, person approves, message sent, CRM updated

See the Pattern library for each of these in detail.

raia Control or a Loop?

raia Control runs outbound campaigns: missions over imported contact lists, with ongoing sequences and campaign reporting. A Loop handles messages triggered by a single event.

The requestUse
Message everyone on a list, with follow-ups over timeraia Control
Reply to each new website lead with one personalized emailA Loop triggered by the new lead
Find and prepare prospects, then hand them to a campaignA Loop for preparation, then raia Control for the campaign

Don't choose Control just because the request mentions outbound. And don't build a Loop for every prospect when the real need is a campaign.

Before any outbound message goes live

  • People have consented to hear from you on this channel.
  • Unsubscribe requests are honored and suppression lists are applied.
  • The message types are permitted for this audience.
  • Provider sending limits are known.
  • Someone owns legal and compliance sign-off.
  • Early messages are reviewed by a person before automation takes over.

Learn more: Loops and Missions.