add_connection
Create a connection between nodes in an n8n workflow by specifying source and target node IDs, their respective handles, and the workflow name.
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_name": "<workflow_name>",
"source_node_id": "<source_node_id>",
"source_node_output_name": "<source_node_output_name>",
"target_node_id": "<target_node_id>",
"target_node_input_name": "<target_node_input_name>"
},
"name": "add_connection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_node_id | Yes | The ID of the source node for the connection | |
| source_node_output_name | Yes | The name of the output handle on the source node (e.g., 'main') | |
| target_node_id | Yes | The ID of the target node for the connection | |
| target_node_input_index | No | The index for the target node's input handle (default: 0) | |
| target_node_input_name | Yes | The name of the input handle on the target node (e.g., 'main') | |
| workflow_name | Yes | The Name of the workflow to add the connection to |