Started by user message
How agents process messages initiated by users
User message flow
This flow is triggered when a user sends a message to the agent’s configured WhatsApp number.
The sequence is as follows:
Message arrival
WhatsApp delivers the user’s message to Kapso’s webhook.
Message queueing
Kapso acknowledges the message and queues it for processing.
Debounced processing
Kapso waits for the configured “Message Debounce” period. If more messages arrive from the same user within this time, the timer resets. Processing starts only after the debounce duration elapses without new messages. This ensures the agent receives the full context.
Agent execution
Kapso gathers the message(s), identifies the Agent and conversation state, and starts or resumes Agent execution.
- For new interactions or completed flows, execution starts at the
Start
node. - If paused awaiting input, execution resumes at the waiting node.
Graph execution
The agent navigates the graph, executing node prompts or actions.
Pausing for input
If a node requires user input, the agent sends the prompt and pauses execution.
Ending execution
Execution continues until an End
node is reached.
Resuming paused conversations
When a user responds after a pause:
- The agent resumes exactly where it left off.
- The new message is treated as the response to the previous prompt.
- Conversation context and variables are preserved.
- The agent continues graph execution from the resumed node.