Loop Node Types

A reference of every step type a loop automation can use, grouped by purpose, plus how steps connect (edges, conditions, fan-out, and templating).

A loop is an automation built as a graph of steps. This page lists the step types you can use and what each does. For what a loop is, how it is triggered, and the ready-made recipes, see loops-and-recipes.md. To script a conversation inside a chat instead of automating work around it, see chat-flows.md.

Thinking and deciding

  • agent_prompt. The core AI step. Runs a prompt and returns text, or, with an output format, structured fields. Set the prompt, an optional output format, and the model.
  • eval_agent. Asks the AI a yes or no question about the input and returns a pass or fail verdict with a reason, for the next steps to branch on.
  • decision. A cheap, fast typed classifier. Asks a question about the input and returns one typed answer plus a confidence score, either yes or no, or one label from a list you set (for example refund, complaint, or question). Set a confidence threshold and the next steps branch on the answer or on whether it was confident (decision and confident). It is like eval_agent but cheaper, quicker, and able to pick from a list, not just yes or no. If it is ever unavailable it falls back to a normal AI verdict, so the loop keeps running.
  • conditional. A no-AI gate. Evaluates an expression against the input and returns true or false.
  • branch. A routing step. Decides which path to take, either from an expression or by asking the AI.
  • output. An explicit end point that captures the loop's final result. Optional, since any step with nothing after it already ends that path.
  • trigger. An explicit start step that passes the loop's input through, so later steps can read the triggering event's fields.
  • function. Calls one of your tools or a built-in capability by name, with inputs you fill in. Several capabilities below are used this way.

Working with conversations and the inbox

  • find_conversations. Finds conversations by search, tags, or inbox, and returns a list to act on (often fanned out over, see below).
  • assign_conversation. Moves a conversation to a different bot, which turns that bot on for it. This is how triage routing works.
  • hand_to_bot. Hands a contact to a bot on one channel (WhatsApp, SMS or Instagram). It reuses the contact's newest open thread on that channel, whichever bot has it, so a thread someone moved isn't opened twice; with none it opens one (Instagram only reuses a thread the contact wrote to in the last 24 hours). With bot_id (the bot's public id, like bot_ab12...) the thread moves to that bot; without it an existing thread stays where it is and a new one goes to the channel's bot. autopilot is off by default (the bot waits for a person), on (the bot answers their replies itself, unless a teammate has the thread) or default (the bot's own setting). context (text, or an object such as the order) is stored where the bot reads it every turn. message is an optional opening message: a WhatsApp template with its variables (or text inside the 24-hour window), or an SMS or Instagram text. A template is saved in the thread as its text, so the bot knows what was said. If the message is refused (opted out, window closed) nothing is handed over and status is skipped with the reason; otherwise status is handed, with conv_id, bot_id and message_status. Pair it with the No reply from customer trigger (conversation.no_reply) to have a bot or a person follow up a contact who went quiet.
  • assign_to_member. Hands a conversation to a human teammate and pauses the bot on it. Name the teammate with user_id, or let strategy pick one (least_busy, round_robin or random), optionally among those whose title or role matches role. The teammate is notified (see the inbox).
  • tag_conversation. Adds or replaces tags on a conversation. Mode merge (default) adds, replace replaces every tag, and category swaps only the conversation's Inbox category and keeps other tags; tagging unclear in category mode does nothing. Triage loops use category.
  • write_to_conversation. Posts a message into a conversation.
  • open_inbox_thread. Opens or creates an inbox thread for a contact.
  • suggest_template. Suggests a template send for a teammate to approve in the inbox.
  • add_suggestion. Adds a suggestion card to the inbox for review.
  • member_records. Reads a bot's member data (memories, profiles) as a source for a report.

Messaging a customer

  • message_contact. Messages the contact on the first channel that works, in the order you set (by default WhatsApp, then SMS, then email). Give each channel its own content: a WhatsApp template (or text inside the 24-hour window), an SMS text, an email (subject and a template or HTML), an Instagram text. A channel the contact has no address for, has opted out of, or can't be reached on right now is skipped and the next one is tried. The result says which channel it used (channel) and why the others were skipped (tried); status is not_sent when none worked. Web chat can be listed but is always skipped for now.
  • send_email. Sends an email (plain, HTML, or a template, including a design from Email > Designs). The triggering event's values are merge values by default, so a design's order summary shows the order that started the run.
  • send_whatsapp. Sends a WhatsApp message (text or an approved template).
  • send_instagram. Sends an Instagram DM over the contact's existing thread. Instagram has no templates, so it only reaches a contact inside the 24-hour window. A contact outside it is skipped, with the reason.
  • send_sms. Texts a contact from your default SMS number (or a number you name) and writes it into their SMS thread. Needs a connected text message provider and a number turned on in Channels > SMS; otherwise it skips with the reason no_sms_number. See Text messages (SMS).
  • send_widget_link. Sends a link to a widget (a form or a custom component).
  • send_chat_link. Sends a link that moves the conversation to web chat, and can start a flow there when the person opens it.

Bookings, reviews, documents, and courses

  • booking_query. Lists appointments for a scheduled loop to act on, one item each for a fan-out. It doesn't look up availability. mode is:

    • reminders_due (default): booked or confirmed, starting within within_hours (24 by default), with no reminder stamped yet.
    • no_shows_due: still booked or confirmed after their end time, with no follow-up stamped yet. It does not read the no-show mark, so it also lists people who came but weren't marked completed. Mark appointments completed (or have the follow-up ask before assuming they missed it).

    Stamp each one with booking_action (mark_reminder_sent, mark_followup_sent) so the next sweep skips it.

  • booking_action. Creates, cancels, or changes an appointment.

  • review_request. Asks a contact for a review.

  • document_action. Signs a document or marks an invoice paid (action is sign or mark_paid, with the document's document_token). A loop can't create or send a document. Create one with oalo call documents:create (see Business kits).

  • course_enroll. Enrolls a person in a course.

  • program_enroll. Enrolls a person in a Fitness kit program.

Media

  • inspect_video. Sends a video or image to AI vision for analysis, with a failure path you can branch on.

Scheduling and waiting

  • wait. Pauses this loop for a set time (for example two days), then resumes at the next step. It does not tie up anything while it waits.
  • wait_for_reply. Pauses until the contact replies (on WhatsApp, SMS, email or Instagram, or only the channels you pick) or the time runs out (two days by default). The next step gets replied (true or false) and, when they replied, reply with the channel and their message, so you can branch: {{input.replied}}. It needs a contact, which an Order placed or message trigger provides. A test run doesn't wait: it takes the "no reply" path.
  • schedule_event. Fires an event later that starts another loop, without pausing this one.
  • remote_step. Runs one handler on the business's own computer, through oalo serve, waits for its answer, then continues with it. Set handler (the machine tool's name) and input. The loop parks while it waits, like wait. If the machine is offline, the step waits for it until timeout_ms (two minutes by default, at most an hour), or continues at once with offline: route. A failure continues with _ok: false and an _error_code, so check {{input._ok}} in the next step. A test run doesn't call the machine. It can't run inside a for_each. Setting up the machine: Answer from your own data.

CRM and team actions

These are added as a function step (the function type above, called by name):

  • create_opportunity / update_opportunity. Create a deal, or move and close one.
  • create_task. Create a task (title, optional assignee, due_at). It lands in the inbox suggestions, and the assignee is notified.
  • notify_team. Send text to the team. With no user_id, every teammate is notified (in-app and by email, per their notification settings) and the text is posted to team chat. With a user_id, only that teammate is notified. Nothing is sent from a test chat.
  • set_contact_data. Set fields on a CRM contact.
  • set_contact_tags. Add or remove contact tags (add, remove: a list or "a,b"). The contact is contact_id, or email, phone or external_ref (created if new).
  • set_suppression. Opt a contact out of, or back into, a channel.
  • enroll_in_loop. Run another loop now for this contact (loop: its name, optional payload). The other loop must be on.
  • data_search. Search a data model by meaning.

Code tools

A code tool is a small JavaScript function the workspace writes, called from a function step or by a bot like any other tool. Only admins and members with Developer access can create or change one.

Its db_query op reaches:

  • the app's tables in the env it runs in (dev for a draft bot, prod for a published one), read and write, by plain name (FROM workouts). No CREATE, ALTER or DROP.
  • read-only views of this workspace's own data. They already show only this workspace's rows, so no org_id filter is needed:
    • workspace.contacts: id, email, phone, name, status, source, custom_fields, external_ref, first_seen_at, last_seen_at, created_at, updated_at, suppressed_at, deleted_at.
    • workspace.contact_tags: contact_id, tag, created_at.
    • workspace.events: id, type, contact_id, source, app_id, payload, occurred_at.
    • workspace.conversations: id, bot_id, status, contact_id, external_ref, tags, collected_data, started_at, completed_at, last_message_at, message_count, assigned_user_id, autopilot, total_cost_usd.

Nothing else: the platform's own tables (users, members, sessions and the like) fail with "permission denied". The workspace.* views are for a code tool's own SQL. oalo db query (and the MCP oalo_db_query) reads the app's tables in an env, not these views; to look at contacts, tags or events from the CLI use oalo metrics, oalo call crm:list_contacts or a test run of the tool. Its invoke_tool op calls other code tools only, not built-ins like notify_team; to notify the team or send a message, follow the code tool with a function step. Any op the sandbox doesn't have fails with "unsupported op".

Maintenance

  • recompute_segments. Recomputes your customer segments across all contacts. Meant to run on a daily schedule.

How steps connect

Steps are joined by edges that carry an optional condition. When a step finishes, each outgoing edge's condition is checked against that step's output. Every edge whose condition matches is followed, and an edge with no condition is the default taken only when nothing else matched. Conditions are simple expressions written against the step's output, with no prefix, for example result.score >= 80, verdict.pass == true, status == "error". The operators are the usual comparisons plus contains, exists, missing, and !.

Doing a step once per item (fan-out)

Any step can run once per item in a list. Set the step to fan out over a field that holds a list (for example the conversations that find_conversations returned), and give the item a name. The step then runs for each element, with that element available to the step's templates. This is how a loop acts on many records in one run.

Passing values between steps (templating)

Steps read earlier values with template references:

  • {{input}} and {{input.<field>}} are the step's incoming input: the previous step's output. Only the first step of an event-triggered loop gets the event itself here.
  • {{trigger.payload.<key>}} reads the event that started the run, from any step. {{loop.input}} is the same value.
  • {{<step>.<field>}} reads any earlier step's output by the step's id.
  • {{<item>.<field>}} reads the current item inside a fan-out.
  • {{loop.iteration}} is how many steps the run has executed so far.

A step is referenced directly by its id, with no state. prefix, the same as in chat flows. The older {{state.<step>.<field>}} form still works.

Reading your workspace's files

The Files page holds your workspace's reference files: brand guides, price sheets, house rules, designs, zips and cloned repos. An agent_prompt step can read them. List the file names under the step's files.reads, then put {{org_file.<file name>}} in the prompt, for example {{org_file.house-rules.md}}. Text files (Markdown, plain text, CSV, JSON, HTML) come in whole. Anything else, like a PDF or an image, comes in as its link.

  • A step finds a file by its name, so a new version needs the same name.
  • Anyone with a file's link can open it. The link is long and hard to guess, but it isn't private, so keep private documents in a bot's Knowledge tab instead.
  • Admins, and teammates whose access includes Files, can upload and delete. Deleting a file removes its link too, and a step that reads it then gets an empty value.
  • Emails can attach these files (see email.md).
Start with Oalo

Your own Base, with every feature, from $99 a month.

get started