Overview
This node, named "Composite," allows users to create a reusable tool within n8n that can encapsulate multi-step logic. It is designed to either process input parameters and send them to a sub-workflow or return processed results from a sub-workflow back to the main workflow. This flexibility makes it useful for building modular workflows where complex operations are abstracted into a single node.
Common scenarios include:
- Defining a custom set of parameters that are validated and transformed before being passed to another workflow.
- Returning processed data from a sub-workflow in a structured way.
- Reusing complex logic across multiple workflows by encapsulating it inside this composite node.
For example, you might use this node to gather user inputs, validate and convert them to appropriate types, then send them to a sub-workflow for further processing. Alternatively, you could use it to receive results from a sub-workflow and map them into a specific property in the output.
Properties
| Name | Meaning |
|---|---|
| Tool Name | The name of this custom tool/node. |
| Tool Description | A description explaining what this tool does. |
| Mode | Operation mode of the node: - Process and Send: Process parameters and send to sub-workflow via second output. - Return Result: Return processed data from sub-workflow to main output. |
| Parameters | (Shown only in "Process and Send" mode) Defines input parameters for the tool. Each parameter includes: - Name: Parameter name. - Type: Data type (String, Number, Boolean, Object, Array). - Description: What the parameter does. - Required: Whether the parameter must be provided. - Default Value: Default value if none provided (JSON format for objects/arrays). |
| Include Original Data | (Shown only in "Process and Send" mode) Whether to include the original input data in the output. |
| Result Property | (Shown only in "Return Result" mode) The property name under which to store the final result in the output JSON. |
Output
- In Process and Send mode, the node outputs an array of items on its main output. Each item contains the processed parameters as JSON, including metadata about the execution and optionally the original input data. If errors occur and "Continue On Fail" is enabled, error information is included in the output with metadata.
- In Return Result mode, the node outputs the received data wrapped inside an object under the specified result property name. Metadata about completion time and mode is also added if present.
The output JSON structure typically looks like this:
{
"<resultProperty>": { /* processed data */ },
"_compositeMetadata": {
"completedAt": "ISO timestamp",
"mode": "return"
}
}
In "Process and Send" mode, each output item includes:
{
"<parameterName>": <value>,
"_compositeMetadata": {
"toolName": "Tool Name",
"nodeId": "Node ID",
"executionId": "Execution ID",
"timestamp": "ISO timestamp",
"itemIndex": 0
},
"_originalInput": { /* original input data, optional */ }
}
No binary data output is produced by this node.
Dependencies
- No external services or APIs are directly required by this node.
- It relies on standard n8n workflow context such as node parameters, execution ID, and paired item indexing.
- Proper configuration of sub-workflows connected to this node is necessary for full functionality.
Troubleshooting
- Missing Required Parameter: If a required parameter is not provided, the node throws an error specifying which parameter is missing. Ensure all required parameters are supplied.
- Invalid Parameter Type: If a parameter cannot be converted to the specified type (e.g., number conversion fails), an error is thrown. Verify parameter values match their declared types.
- Invalid JSON in Default Values: For parameters of type Object or Array, default values must be valid JSON strings. Invalid JSON will cause parsing errors.
- Error Handling: If "Continue On Fail" is enabled, errors for individual items do not stop execution but are returned as error objects in the output. Otherwise, the node stops on the first error.
- Mode Misconfiguration: Using properties relevant to one mode while in the other mode may lead to unexpected behavior. Make sure to configure properties according to the selected mode.