Skip to content

WhatsApp chat assistant

Customers message your WhatsApp number at all hours and expect an answer. This workflow replies automatically: every inbound message goes to an AI assistant that has read the conversation so far, and its reply goes straight back over WhatsApp. Four tasks, and the customer never waits.

A WhatsApp chat assistant on the BaseCloud canvas. A WhatsApp Message Received trigger connects to an AI Prompt task, which connects on to a WhatsApp Business task. The AI Prompt node has two extra ports beneath it labelled memory and tool; a dashed line runs from the memory port down to a separate Chat Thread node, which sits off the main chain rather than in it

The workflow

Order Task Purpose
1 WhatsApp Message Received Starts the workflow when a customer messages you
2 AI Prompt Writes the reply, in Chat Agent mode
— Chat Thread Hangs off the AI task's memory port so the assistant can see the earlier messages
3 WhatsApp Business Sends the reply back to the customer

Chat Thread has no order number on purpose. It is not a step in the chain — it is a reference node the AI task reads from, which is why it sits below the flow rather than in it.

1. WhatsApp Message Received

The WhatsApp Message Received trigger configuration panel. A banner marks it as a trigger task that starts the workflow. A note lists its output variables: session_id, which is the sender and is used as the AI memory session key, message, message_type, message_id, from_number, profile_name, contact_name, contact_surname, client_id, contact_id, phone_number_id, timestamp, assigned_user_id and assigned_user_name. Below are a WhatsApp connection selector, noting each connection can have only one trigger and that connections already used are disabled, and a Run this workflow for selector set to only chats assigned to Automation Trigger

Field Set it to
WhatsApp Connection The number customers message
Run this workflow for Only chats assigned to Automation Trigger while you are testing

One trigger per connection

A WhatsApp connection can only have one trigger. Once a connection is used, it is disabled in every other trigger task, so you cannot accidentally wire two assistants to the same number.

Run this workflow for decides how much of your traffic the bot handles. Leaving it on Only chats assigned to Automation Trigger means the assistant answers only the conversations you deliberately hand it. Every incoming message puts it in front of everyone.

The trigger passes on the sender and the message. The two the rest of the workflow needs are {{task_35708_from_number}} and {{task_35708_message}}.

2. AI Prompt

The AI Prompt task configuration panel. An Input field accepts a value or a dragged chip, the AI Model is set to OpenAI GPT-5 Mini (Balanced), and the analysis type is set to Chat Agent. A note explains that Chat Agent turns the task into a conversational assistant whose persona comes from the prompt below, and that connecting a Chat Thread node to the memory port lets it remember the conversation. Below is a System Prompt editor holding the assistant's instructions

Field Set it to
Input {{task_35708_message}} — what the customer just said
AI model OpenAI · GPT-5 Mini (Balanced) is a sensible starting point
What type of analysis do you want to do? Chat Agent
System Prompt (assistant persona) Who the assistant is and what it may say

System Prompt (assistant persona) only appears once you choose Chat Agent. It is the assistant's character, not a question — write it as instructions:

You are a friendly support agent for Acme Plumbing.
Answer questions about our services, hours and pricing.
If you are not sure, say you will pass the question to a person.
Never quote a price for emergency callouts.

The reply comes back as {{task_35710_output}}.

The memory port

The lower half of the AI Prompt panel. Beneath the System Prompt editor, two notes explain the extra ports: chat memory, where a Chat Thread node connected to the memory port loads live WhatsApp and Text history read-only and, with nothing connected, the task runs as a one-shot prompt with no memory; and tools, where read-only tasks such as Match Client, Files or Google Sheets Get Rows connect to the orange tools port and have their output added to the prompt as reference data, with write actions on a linked Sheets task ignored

Without a memory node the assistant answers each message in isolation and will cheerfully ask a customer something they already told it. Connecting a Chat Thread node to the memory port fixes that.

The Chat Thread task configuration panel. It retrieves the full historical message thread for a contact number on a WhatsApp or SMS channel, and outputs each message with its sender and timestamp plus a ready-to-use transcript. Fields are Contact Number, which accepts a number in international format or a dragged variable chip, Message Type set to Text, and a limit for the most recent N messages defaulting to 100

Field Set it to
Contact Number {{task_35708_from_number}}
Message Type WhatsApp
Limit (most recent N messages) 100 is the default and is usually plenty

Message Type defaults to Text, not WhatsApp

If you leave the dropdown alone, the node reads the customer's SMS history and the assistant will behave as though the WhatsApp conversation never happened.

Memory is read-only. The Chat Thread node loads the live history; it never writes the conversation back, because the chat channel already stores every message itself. Memory is also only available in Chat Agent and Custom Prompt modes — pick another analysis type and the memory node is ignored.

3. WhatsApp Business

The WhatsApp Business task configuration panel, which sends messages and manages templates through Meta's official WhatsApp Business Cloud API. A connection selector notes that accounts are connected in Settings, WhatsApp, and cannot be added here. Action is set to Send Template. A Recipient field expects a WhatsApp number in full international format or a dropped contact-number variable. A Template field asks for a connection to be chosen first, and an optional Header File field accepts a link or a variable to override the template's own document

Field Set it to
WhatsApp Business Connection The same number as the trigger
Action Send Text (session only)
Recipient {{task_35708_from_number}}
Message Text {{task_35710_output}}

The screenshot shows the default, which is not what you want here

Action defaults to Send Template, and that is what the panel above shows. A template is for starting a conversation. An assistant is replying inside one, so change it to Send Text (session only).

Free-form text can only be sent while the 24-hour customer service window is open. Because this workflow is triggered by the customer's own message, that window is open by definition — which is exactly why the assistant may reply in its own words. The task also reports session_open and session_expires_at if you want to check.

Test it

  1. Leave Run this workflow for on Only chats assigned to Automation Trigger.
  2. Assign one chat — your own number is ideal — to the Automation Trigger user.
  3. Send yourself a message and watch the run.
  4. Read the AI task's OUTPUT panel to see the reply before it goes out.
  5. Send a follow-up that only makes sense in context, such as "and how much is that?", to prove the memory node is working.
  6. Switch to Every incoming message when you are happy.

What can go wrong

Symptom Cause
The assistant answers, but has forgotten everything Message Type on the Chat Thread node is still Text, so it is reading SMS history.
No reply, and the WhatsApp task never ran The AI task reported Not the latest chat message from user. See below.
No open 24-hour session with … The window closed — more than 24 hours since the customer's last message. Only a template can reopen it.
The reply is empty The AI task failed; check its run_text. The WhatsApp task will refuse an empty Message Text.
Nothing happens at all The chat is not assigned to the Automation Trigger user and the filter is still set to assigned chats only.

Three quick messages get one reply, not three

Before answering, a Chat Agent checks that the message that triggered it is still the newest one in the thread. If the customer has typed again in the meantime, the run stops with Not the latest chat message from user — no children tasks were run. and no tokens are spent. The last message wins, which is almost always what the customer meant.