modify_workflow
Modify ComfyUI workflows by applying operations: set input values, add or remove nodes, connect nodes, or insert nodes between connections. Returns updated workflow JSON and new node IDs.
Instructions
Apply modification operations to an existing ComfyUI workflow. Supports: set_input, add_node, remove_node, connect, insert_between. Returns the modified workflow JSON and IDs of any newly added nodes.
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": {
"workflow": "<workflow>",
"operations": "<operations>"
},
"name": "modify_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow | Yes | ComfyUI workflow JSON (as a JSON string or object) | |
| operations | Yes | Array of operations to apply in order. Each has an 'op' field: set_input, add_node, remove_node, connect, or insert_between |