apply_operations
Apply a batch of operations to the flow at versionId, in order, then save — one call for everything you need built, not one per block/edge. Operations: add_block, configure_block, wire_edge, remove_edge, remove_block, set_condition_parts, add_router_case, remove_router_case, add_ai_router_decision, set_data_bucket_fields, add_agent_tool, configure_agent_tool, remove_agent_tool, add_placeholder, update_placeholder, remove_placeholder, set_flow_descriptions; each variant describes its fields. A LIVE version (list_flows' liveVersionId) cannot be edited: the whole batch is rejected. To change a live flow: stop_flow (pause_flow does not make it editable), apply_operations, then start_flow if it should run again. Atomic: if any operation fails, nothing is applied or saved; the error names the failed operation's index — fix it and resend the whole batch. localAlias: add_block (nodeId), add_router_case (caseId), add_ai_router_decision (decisionId) and add_agent_tool (the new toolId) accept a localAlias — any string (e.g. "trigger1"), unique across the batch. Any later operation in the same batch can pass it wherever that id is expected (nodeId, groupId, fromNodeId, toNodeId, branch, caseId, toolId); it is replaced by the generated id once the creating operation has run. It exists only within this call; for anything created before the batch use the real id. Result: { id, version, elementCount, status, errorMessage, results, issues, suggestions } — status/errorMessage: the server's verdict; results: one { index, operationName, operationResult } per operation, in order; issues: validation state of the final flow after all operations (as get_flow_summary shows), not per operation — they never block the save; fix them in a later batch. suggestions: optional improvements (descriptions for callers); they never affect running the flow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| versionId | Yes | ||
| operations | Yes | ||
| workspaceId | Yes |