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:

1

Message arrival

WhatsApp delivers the user’s message to Kapso’s webhook.

2

Message queueing

Kapso acknowledges the message and queues it for processing.

3

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.

4

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.
5

Graph execution

The agent navigates the graph, executing node prompts or actions.

6

Pausing for input

If a node requires user input, the agent sends the prompt and pauses execution.

7

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.