Create an automation
create_automationCreate a chatbot flow for the connected accounts. Without graph it creates an empty one to fill in later; with graph it validates and saves the whole thing. A flow can send messages to the people who trigger it, tag and update those contacts, enroll them in sequences and notify the team; on a comment trigger it can also answer in PUBLIC on any network with comments (comment_reply, or ai / ai_agent with replyIn "public" — the only option on YouTube, LinkedIn, Threads and TikTok). Steps that call external services are not available here. Always created INACTIVE: review it with preview_automation and enable it with set_automation_active after the user agrees.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| graph | No | Node graph. Every graph begins with a `start` node: {"start":"start","nodes":[{"id":"start","type":"start","next":"n1"},{"id":"n1","type":"message","text":"Hi","next":"n2"},…]}. See get_automation_node_types. | |
| trigger | No | What starts it: {"type":"keyword","keywords":["price"]} | {"type":"comment","keywords":[…],"scope":"any"|"next"|"existing","postIds":[…]} | {"type":"story"} | {"type":"welcome"} | {"type":"manual"}. On a comment trigger, `scope` picks the posts it watches: "any" = every post; "next" = the next post that gets PUBLISHED after this is saved (drafts and scheduled posts do not claim it; needs accountIds); "existing" = the posts in `postIds` (post URLs or native ids). Add `"oncePerContact":true` to any trigger except welcome so a person who already went through the flow never gets it again (repeating the keyword or commenting again does nothing). On a comment trigger, add `"onceScope":"post"` to make it once per person PER POST instead (commenting on another post does get it). | |
| accountIds | No | Accounts it applies to. Empty = every account of the organization. | |
| workspaceId | No | Workspace to work on (an id from list_workspaces). Not needed when this connection is tied to one workspace, or when you pass an account: the account's workspace is used. | |
| idempotencyKey | No | Optional. A unique id for this action (16-128 chars: letters, digits, _ : . -). If you are unsure whether a call went through (timeout, network error), repeat it with the SAME idempotencyKey and the same arguments: you get the original result and nothing is done twice. |