Save DM automation
save_dm_automationCreates an Instagram/Facebook DM automation from a flow, or changes one when automationId is given. A flow has triggers (comment on a post, incoming DM, story reply or mention) and an ordered tree of steps (messages, quick-reply questions, link cards, follow check, email and phone number capture, delays, tags, AI agent, public comment reply). The flow is validated like the editor does plus extra checks; errors are returned and nothing is saved. A new automation is saved INACTIVE with the next execution order number, as the editor does; activation is a separate step (set_automation_status). A change replaces the whole flow (the flow as get_automation returns it, edited; steps that keep their ref keep their statistics and the contacts in the middle of the flow) and/or the name and settings; active stays active, inactive stays inactive. A change is refused when the stored automation has parts the flow model cannot represent, unless overwriteUnsupported is true. May first return a confirmation summary and token instead of acting.
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": {
"brand": "<brand>"
},
"name": "save_dm_automation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow | No | The complete flow. Required when creating; when changing, omit to change only name or settings. | |
| name | No | Required when creating. | |
| brand | Yes | ||
| automationId | No | Id of the automation to change. Omit to create one. | |
| expectedVersion | No | Changes only: the version from get_automation. If someone saved in between, the change is refused instead of overwriting. | |
| confirmationToken | No | ||
| applyBusinessHours | No | Delay runs outside the brand's business hours. New automations: false. | |
| mediaToAddInEditor | No | Media for this flow that no tool can upload ("audio" = voice message). The flow is saved without those steps; the result note names them with the editor link. | |
| triggerOncePerUser | No | Run at most once per contact. New automations: false. | |
| overwriteUnsupported | No | Changes only: replace a stored flow that has parts the model cannot represent (listed in notEditableParts). Those parts are lost. |