update_flow_definition
Replace an existing flow's complete node-and-edge graph to update automation logic, routing, and message handling in one call.
Instructions
Replace the full node+edge graph of an existing flow.
Node schema reference:
WapiSender Flow Node Types:
trigger: { type: "trigger", data: { match: "any"|"contains"|"exact"|"regex", keywords: string[] } }
send_message: { type: "send_message", data: { messageType: "text"|"image"|"video"|"document"|"audio"|"voice"|"buttons"|"list"|"location"|"poll"|"sticker", text?: string, mediaUrl?: string, audioUrl?: string, stickerUrl?: string } }
condition: { type: "condition", data: { source: "last_message"|"custom", variableName?: string, operator: "equals"|"contains"|"starts_with"|"ends_with"|"regex", value: string } } condition has two output handles: "true" and "false"
delay: { type: "delay", data: { amount: number, unit: "seconds"|"minutes"|"hours"|"days" } }
webhook: { type: "webhook", data: { method: "GET"|"POST"|"PUT"|"PATCH"|"DELETE", url: string, headers?: object, body?: string, responseVariable?: string } }
wait_for_reply: { type: "wait_for_reply", data: {} }
human_handoff: { type: "human_handoff", data: { message?: string, resumeAfterMinutes: number } }
ai_agent: { type: "ai_agent", data: { mode: "reply"|"router"|"extract", credentialId: string, provider: string, model: string, systemPrompt: string, promptTemplate: string, outputVariable: string } }
end: { type: "end", data: {} }
Edge format: { id: "e1", source: "nodeId", target: "nodeId", sourceHandle?: "true"|"false" } Positions: spread nodes with ~250px vertical spacing starting at { x: 250, y: 100 }
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>",
"nodes": "<nodes>",
"edges": "<edges>"
},
"name": "update_flow_definition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | Yes | Array of flow edges | |
| nodes | Yes | Array of flow nodes | |
| flowId | Yes | Flow UUID |