create_automation
Creates an inactive WhatsApp automation from a trigger and ordered steps, letting you review the flow before separate approval activates message sending.
Instructions
Create an automation. It is always born INACTIVE and this tool never activates it: nothing is sent until the user approves set_automation_active. Shape: {name, trigger, triggerConfig?, steps}. All wire values are lowercase. Triggers: webhook, cart.abandoned, payment.failed, tag.applied, conversation.started, button.replied, charge.paid, charge.expired. A step is {type, config, branches?}. Types: message {templateId, variables[]} or {sessionText} ({sessionText, chargeFromRun:true} sends the charge that came with the trigger); wait {minutes}; condition {tag}; tag {tag}; question {mode:'buttons'|'list'|'template', text, buttonText? (list only), options:[{id,title,match[]}], timeoutMinutes, retryText?, templateName?/templateId?/variables? (template mode)} with branches keyed by option id plus '__timeout' and '__other'; wait_payment {timeoutMinutes} with branches 'paid' and 'unpaid'. Hard rules: at most 2 levels of branching steps (question / wait_payment inside a branch counts as level 2); buttons take up to 3 options with title up to 20 chars; list takes up to 10 options with title up to 24 chars; sessionText and question modes 'buttons'/'list' only reach people inside the 24h WhatsApp window, so the FIRST message to someone outside it must be a template message or a question in 'template' mode. Pick templateId from list_automation_templates. Example: {"name":"Carrinho","trigger":"cart.abandoned","steps":[{"type":"wait","config":{"minutes":30}},{"type":"question","config":{"mode":"template","templateName":"carrinho_lembrete","variables":["{{name}}"],"text":"Ainda quer o pedido?","options":[{"id":"sim","title":"Quero","match":["sim","quero"]},{"id":"nao","title":"Agora nao","match":["nao"]}],"timeoutMinutes":1440},"branches":{"sim":[{"type":"message","config":{"sessionText":"Segue o link: https://loja.example/checkout"}}],"nao":[{"type":"tag","config":{"tag":"sem-interesse"}}],"__timeout":[{"type":"tag","config":{"tag":"sem-resposta"}}]}}]}. When the API refuses the payload it answers with a sentence saying what to fix; correct the payload and call again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"trigger": "<trigger>",
"steps": "<steps>"
},
"name": "create_automation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| steps | Yes | ||
| trigger | Yes | ||
| triggerConfig | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| error | No |