Multi-step WhatsApp automations: chain replies, AI, webhooks and waits
A multi-step WhatsApp automation runs a flow of steps on one incoming message: up to 30 per line and 60 in all, in order, with branches that hold lines of their own. Steps can send text, a file, a template or an AI reply, ask a question, call your webhook or wait up to 23 hours. A step that sends text sends its own separate message.
easyCoexistence runs multi-step automations on the WhatsApp Business number you keep in the app, through Meta's Cloud API: fixed replies, templates, AI on your own key, your webhook, waits and branches, up to 30 steps per line, with a run log for 30 days.
Steps per automation, branches included: 30 per line, nested 4 deep; at least one does more than Wait, Stop, Go back or branching.
The longest single Wait, 23 hours. Waits count toward the 60 steps.
How long Call my webhook waits for an answer; a reply returned in time is sent, a timeout fails the step.
Recent chat messages the webhook receives, including replies that earlier steps of the same run sent.
At most one failure email per automation in this time; the Runs tab keeps the failed runs.
How does a multi-step automation run?
Top to bottom, once per incoming message the automation is picked for. Each step runs, its output goes into the run log, and the next one starts; at a branch, the first path whose rules hold runs and the flow then goes on below it. The run ends Done after the last step; Stop, "End the automation", is optional and only allowed last in its line, so it marks the end in the diagram without changing what happens. Two things end a run early. A failure, such as a webhook that does not answer, marks the step Failed, skips every step after it, waits included, ends the run Failed and emails you so you can answer that customer yourself. A guard, such as the 24-hour window, the AI cap or your reply from the phone after a wait, ends the run Skipped with its reason, and the rest does not run.
What does each step do inside a chain?
Any step can follow any other. What changes is what each one sends and which rule it checks when its turn comes. Two details make chains work: Reply with AI reads the chat including what earlier steps of the run just sent, so it does not repeat your greeting, and Call my webhook receives those replies in its history too. The grid shows the six basic steps; the editor also offers Ask a question, Split into paths, AI picks the path, Agent answers, Send a picture or file, Call an API, Save to contact, Tag, Hand to a person and Go back to a step.
What is the double-message trap after a webhook?
A step after Call my webhook runs whether or not the webhook replied, because its reply is sent, not kept for a condition. If your system returns {"reply": "..."} and a Reply with AI or Reply with text follows, the customer gets two messages to one question. The same happens when your system sends its own message through the Cloud API and also returns a reply. There is no "if the webhook said nothing, let the AI answer" fallback with this step; to branch on your system's answer, use Call an API, whose JSON answer a condition can read. Decide which step speaks:
| The webhook speaks | The webhook records | |
|---|---|---|
| Chain | Optional Reply with text, then Call my webhook, last | Reply with AI or Reply with text, then Call my webhook |
| Your system returns | {"reply": "..."} in every case, including not found | Any 2xx with no reply field |
| The customer gets | Your system's answer | The earlier step's answer |
| Fits | Order status, stock, prices from your database | CRM logging, team alerts, spreadsheets |
Which chains are worth copying?
These use the basic steps and avoid the trap. Each reads left to right, in diagram order, and fits on any trigger unless noted.
- Greeting, then answer: Reply with text "Hi {{
first_name}}, thanks for writing!", then Reply with AI. On First message. - One answer to a burst: Wait 1, then Reply with AI. A newer message that picks this automation replaces the waiting run.
- Hold on, then look up: Reply with text "Checking your order now…", then Call my webhook, which returns the status.
- Answer, then record: Reply with AI, then Call my webhook to your CRM or n8n, which returns no reply.
- Answer, then nudge: Reply with AI, Wait 120, Reply with text "Did that help?". Your phone reply cancels the nudge.
- Next-day reminder: Reply with AI, Wait 1,380, Wait 60, Send a template. Only for customers who opted in.
How do waits change a chain?
A Wait parks the run, shown as Waiting in the Runs tab, and the next step runs when the time is up. Before that step, the run checks whether anyone replied to the chat from the WhatsApp Business app since the run began; if so it ends Skipped with "You answered this chat from your phone recently". A new customer message that picks the same automation replaces the waiting run, logged as "A newer message from the customer took over"; one that goes to a different automation does not. Text steps that wake more than 24 hours after the customer's last message are skipped, while Send a template still goes out. Waits add up: with 11 Waits and one sending step, a run can last about 10.5 days.
How do you build and test a chain?
In the editor's diagram, click "Add a step here" between two blocks, pick from "Choose a step", and fill the panel; "Delete step" removes one. Through the connector, steps is an array in create_automation, and update_automation replaces the whole array, so an assistant adding one step must send all of them. Run test executes the saved chain on a sample message: the AI step and your webhook really run, the webhook receives dry_run set to true, waits are logged as "Would wait 120 min" and skipped, and nothing is sent. A test reads only the sample, so an AI step after a greeting does not see the greeting there, as it does live.
"trigger": {
"type": "message_received",
"match": "keyword",
"keywords": ["order", "pedido", "tracking"],
"keywordMode": "contains"
},
"steps": [
{ "type": "reply_text", "text": "Checking your order now, {{first_name}}…" },
{ "type": "call_webhook", "url": "https://shop.example.com/hooks/order-status" }
]
// Your endpoint answers within 20 seconds, in every case:
// { "reply": "Order #1042 left the shop at 14:20." }
// { "reply": "I couldn't find that order. A person will check it here." }Common mistakes
- Putting Reply with AI after a webhook that returns a reply. Both speak, and the customer gets two answers; let one step speak.
- Sending update_automation with only the new step. Steps are replaced as a whole, so the other steps disappear; read the automation with list_automations and send the full list.
- Expecting a step after a failed webhook to reply instead. A failure skips the rest; return HTTP 200 with a reply even when the lookup finds nothing.
- Placing Stop in the middle to end a chain early. The save is refused with "Stop must be the last step"; delete the steps you do not want.
Build them in the editor's diagram or ask ChatGPT or Claude through the connector. US$ 9 down to US$ 0.75 per number per month, falling as you add numbers, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
Can a step use what an earlier step returned?
Yes. What an earlier step sent reaches later ones as chat history, read by Reply with AI and posted to your webhook. Steps can also pass values on: Ask a question and Save to contact keep answers in contact fields ({{contact.<field>}}), and Call an API keeps its answer as {{vars.<name>}}. The variables {{first_name}}, {{name}}, {{message}} and {{phone}} always come from the message that started the run.
Can one automation send two AI replies?
Yes, with two Reply with AI steps, for example one before a Wait and one after. Each counts as one AI reply against the chat's hourly cap, and each bills tokens to your key.
Do the messages of a chain arrive in step order?
They are sent in step order, one at a time, and sends from a number are spaced at least 100 ms apart, under Meta's 20 messages per second for a Coexistence number. A step starts only after the previous one finished.
What happens to a waiting chain when I edit the automation?
It resumes at the next step number of the automation as saved when it wakes, so an edit can change what it sends. To stop waiting runs, switch the automation Off; they end Skipped with "Automation is off".
Keep reading
Ready to get started?
Set up WhatsApp Coexistence in minutes, not months. The app keeps working on the phone.
Start Free TrialVerified on