Workflows

Draw conversations from components: messages, questions, an AI agent, conditions and your apps.

A workflow is a conversation you draw yourself, on a canvas: what happens when someone comments on your post or sends you a DM. You build it from components: messages, questions, an AI agent, your catalogue, FAQ and media, conditions, variables and your other apps.

You design a workflow once and use it as often as you like: attach it to many posts, or make it your account's DM workflow.

Create one

  1. Open Workflows and choose New workflow. It opens with the DM funnel already drawn, so you can edit instead of starting from nothing.
  2. Add components from the Components palette on the left:
    • drag one onto the canvas, or onto a step to place it below and connect it;
    • press + beside a component to add it under the selected step;
    • press the small + under a step's line to add the next step right on that line.
  3. Select a step to edit it on the right. Press Save when you are done.

On a phone, Add step opens the palette, and tapping a step opens its settings from the bottom of the screen.

The palette

The palette groups components by category (the default): Messages & content, AI, Basic, Integrations. The three buttons beside the title switch to relevance order or A to Z, and the search box finds a component by name or by what it does ("rectify" finds Variables). Integration components appear once that app is connected in Settings → Integrations.

Two ways to use a component

Every component works in workflow mode, tools mode, or both:

  • Workflow mode: the step sits on the flow. The conversation reaches it, it does its work, and the flow leaves by one of its lines (circle ● to circle ●).
  • Tools mode: the step is joined to an AI agent's ◆ (diamond to diamond). It is no longer on the flow: the agent decides when to use it, as one of its tools.
ModeComponents
BothSend DM, Ask in DM, Public reply, Media, Catalogue, FAQ, HTTP API, Notify on WhatsApp, DataMold, CalendarBook, HelloCall, Gmail, Email
Workflow onlyStart, Stop, Keyword check, Follows you?, Condition, Variables, AI agent

See Components for each one: what it is for, when to use it, how to connect it and the tools it gives an agent.

How to structure a workflow

A fixed path: Start → Keyword check → Public reply → Send DM → Stop. Each step does one thing and the lines decide what comes next. Use this when you know exactly what to say.

A question with branches: Ask in DM waits for a tap or a typed answer. Each button has its own line, and "typed something else" catches the rest. Follow it with a Condition or Variables step to work with what they said.

An assistant: Start → AI agent → Stop, with the steps it may use joined to its ◆:

Start ──▶ AI agent ──◆── Send DM     (its voice: replies + reading the chat)
             │     ├──◆── Ask in DM   (questions with quick-reply buttons)
             │     ├──◆── Catalogue   (search items, policies, send cards)
             │     ├──◆── FAQ         (answers you wrote)
             │     └──◆── HTTP API    (your order system)
             ▼ BUY (an action line)
           Send DM "Thanks! Here is the payment link…"

The agent chats until one of its actions fits, then the flow carries on along that action's line. A new agent comes with Send DM already joined: without it, nothing the agent writes reaches the customer.

Mixing both: a Keyword check can send "price" questions straight to a Catalogue step on the flow, and everything else to an AI agent.

Variables

Every run carries variables you can drop into any text with curly braces, like Hi @{username}!. Tap a variable under a text box to copy it.

VariableWhat it holds
{comment}The comment that started the run.
{message}The latest DM they sent.
{username}Their Instagram handle, when Instagram shares it.
{account}Your Instagram handle.
{reply}An AI agent's latest answer (you can rename it).
{response}The last HTTP API answer: {response.status}, {response.ok}, {response.body.some.field}.
{faq.answer}The FAQ answer an FAQ step found ({faq.found}, {faq.question}).
{rectify.ok}Whether the last Rectify step put a value right.

Variables steps, HTTP API, integrations and agents add variables of their own. Variables are kept while the flow waits at an Ask in DM step or a chatting agent. A name the flow never set is left as written.

Try it before it goes live

Press the walkthrough button (▶) to open How it works. Type a comment, press Post comment, and watch the flow run step by step. At an Ask in DM step you can tap a button or type an answer as the follower would. Conditions and Set variable are worked out for real; the AI, your API, your apps and WhatsApp are described, not called.

Attach it

  • To a post: open the post, choose Handle by workflow, pick the workflow and press Save. One workflow can serve many posts, so a change in the designer applies to all of them.
  • To DMs: in Inbox → DM settings (or Settings → Instagram accounts), pick it as the account's DM workflow. It then starts on every new DM.

Import and export

  • Export (designer toolbar) downloads the canvas as a .codm-workflow.json file.
  • Import in the designer replaces the canvas (saved when you press Save). Import on the Workflows list creates a new workflow from a file.

Limits

  • A flow runs at most 20 steps per comment or message, so a loop can never run forever.
  • Instagram allows one private reply per comment; the first DM uses it and later DMs continue the same conversation.
  • An AI agent makes at most four rounds of tool calls per message.

Something unclear or out of date? Tell us and we will fix the page.