Update a chat flow
update_flowChange a chat flow; only the fields you send change, but a graph or a triggerConfig you send replaces the stored one whole (get_flow first). It does not turn the flow on or off — set_flow_active does. If the flow is already active, the edit is live for the next contact at once, in the account's name, so say so before editing a live flow. Writing also needs chat enabled for the organization and an ADMIN or OWNER role in it, and a new flow counts against the plan's flow limit (403 CHAT_FLOW_LIMIT_REACHED) — the same refusals a person gets in the app. Needs the organization's "Let AI assistants create and edit chat flows" setting (mcpFlowsEnabled; only the organization's OWNER can switch it on, in Settings → Organization → General → AI Assistants; without it the api answers 403 MCP_FLOWS_DISABLED) and a connection authorized with the flows permissions — one authorized before they existed must remove PostRite from the assistant and add it 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": {
"flowId": "<flowId>"
},
"name": "update_flow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The flow's name, shown in the app (1 to 200 characters) | |
| graph | No | The flow's graph: { entryNodeId, nodes (1 to 100 nodes), edges }, validated by the same schema the app's flow builder saves with. Every node has a unique `id` (letters, digits, - and _) and a `type`; `position` {x, y} is optional (the builder lays out a graph that has none). Node types and their fields (? = optional): SEND_MESSAGE {text (≤1000), attachments?: [{type: image|video|audio|file, url (≤2048), name? (≤255), mimeType? (≤120), size?, mediaId?, external?}], links?: [{id (≤40), label (≤20), url (≤2000)}]}; WAIT {seconds (integer ≤82800)}; WAIT_FOR_REPLY {quickReplies?: [{id (≤40), label (≤20)}], timeoutSeconds? (integer ≤604800)}; CONDITION {kind: HAS_TAG|ATTRIBUTE_EQUALS|CHANNEL_IS|WITHIN_BUSINESS_HOURS, key? (≤80), value? (≤200)}; ADD_TAG|REMOVE_TAG {tag (≤60)}; SET_ATTRIBUTE {key (≤80), value (≤500)}; REPLY_TO_COMMENT {texts[]}; ASK_INPUT {inputKind: email|phone|text, attributeKey (≤80), timeoutSeconds? (integer ≤604800)}; HANDOFF {note? (≤280)}; END. An edge is { from, to, fromHandle? }; `fromHandle` picks the branch: "next" (or omitted) on most nodes, "true"/"false" out of a CONDITION (it needs both), a quick reply's id or "timeout" out of WAIT_FOR_REPLY, "invalid" or "timeout" out of ASK_INPUT. A question is the SEND_MESSAGE that leads into a WAIT_FOR_REPLY: the reply buttons (quickReplies) are offered with that message, and each button becomes a branch. A circular menu is allowed; a run stops after 50 steps. On update_flow, a graph replaces the whole stored graph — send every node and edge, not a patch. | |
| flowId | Yes | The flow's ID (from list_flows) | |
| triggerType | No | Replaces what starts the flow (the same values as create_flow). Omit it to leave the trigger unchanged. It does not turn the flow on or off — a flow that is already active stays active with the new trigger. | |
| connectionIds | No | Replaces the accounts this flow answers on (platform connection IDs, from list_platform_connections). Omit it to leave them unchanged — do NOT send [] to mean 'no change': an empty list means EVERY messaging account in the organization, which on a live flow starts answering on all of them at once. | |
| triggerConfig | No | What starts the flow, read per triggerType. Fields (? = optional): matchMode?: CONTAINS|EXACT|STARTS_WITH|ANY, keywords?[], platformPostIds?[], postId?, ref? (≤120). matchMode and keywords narrow a MESSAGE_RECEIVED trigger (no keywords = every message); platformPostIds narrows COMMENT_RECEIVED to those posts (absent = every post on the account, organic ones included); ref is the REFERRAL value of the ig.me / m.me link. On update_flow: omit it to keep the stored config; what you send REPLACES it whole, so repeat every keyword and post id you want to keep. A config that narrows nothing (no keywords, platformPostIds, postId or ref) is refused on update, because it would make a live flow answer every message or every post; widening a trigger is done in the app. | |
| organizationId | No | Organization to act in — an id from list_organizations. Required when this connection was authorized for more than one organization; omit it when there is only one. | |
| cooldownMinutes | No | Minutes before the same contact can start this flow again. Omit it to keep the stored value. | |
| maxRunsPerContactPerDay | No | How many times one contact can start this flow in a day. Omit it to keep the stored value. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| name | No | ||
| graph | No | ||
| runCount | No | ||
| createdAt | No | ||
| isEnabled | No | true = live: it answers real contacts | |
| updatedAt | No | ||
| triggerType | No | ||
| connectionIds | No | The accounts it answers on; empty = every messaging account | |
| isGraphBroken | No | The stored graph no longer parses; rewrite it with update_flow | |
| triggerConfig | No | ||
| cooldownMinutes | No | ||
| lastTriggeredAt | No | ||
| runCountLast7Days | No | ||
| maxRunsPerContactPerDay | No |