Execution flow
Started by external trigger
How agents process execution initiated by API calls or webhooks
External trigger flow
This flow is initiated programmatically, e.g., via an API call or a configured webhook trigger.
The sequence is as follows:
1
External trigger
An external event (e.g., a POST
request to an agent execution API endpoint) triggers the execution.
2
Agent execution begins
Kapso identifies the target Agent and starts a new Agent execution from the Start
node.
3
Initiating WhatsApp conversation (requires template)
- Constraint: To send the first message to a user via WhatsApp, the first node after
Start
must be aWhatsappTemplateNode
. - Reason: Required by WhatsApp Business API policy.
- Action: The
WhatsappTemplateNode
sends the specified approved template to the target user.
4
Subsequent steps
Graph execution continues.
- Nodes might send further messages (if allowed) or perform actions (e.g., call webhooks).
- Execution pauses if a node requires user input.
5
User reply
If the user replies, their message initiates the User message flow.
6
Ending execution
Execution concludes when an End
node is reached.
WhatsApp template requirements
When initiating WhatsApp conversations programmatically:
- First Message: Must use a pre-approved WhatsApp template.
- Template Node: The Agent Graph must use a
WhatsappTemplateNode
immediately after theStart
node.