insert_macro
Insert a macro sub-workflow into a dynamic ComfyUI workflow, connect its input ports to existing nodes, and return nodeIdMap and outputPorts so you can wire macro outputs.
Instructions
Insert a macro (sub-workflow) into a dynamic workflow. Connects macro input ports to existing nodes. Returns nodeIdMap and outputPorts so you can connect macro outputs. Use workflow_id from create_workflow.
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_id": "<workflow_id>",
"macro_id": "<macro_id>",
"input_connections": "<input_connections>"
},
"name": "insert_macro"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macro_id | Yes | Macro id (e.g. upscale_refine). Use list_macros to see available. | |
| workflow_id | Yes | Workflow id from create_workflow | |
| input_connections | Yes | Map port name -> [source node id, output index] for links, or literal (e.g. filename for LoadImage) |