Package Information
Available Nodes
Documentation
n8n-nodes-lodash
This is an n8n community node that allows you to execute Lodash functions directly within your workflows. It provides access to a wide range of utility functions for manipulating arrays, objects, strings, and more.
n8n Version Compatibility
This node has been tested with n8n version 1.0.0 and later.
Installation
- Go to Settings > Community Nodes.
- Select Install.
- Enter
n8n-nodes-lodashin the Enter npm package name field. - Agree to the risks of using community nodes.
- Click Install.
After installation, the Lodash Function node will be available in the "Transform" section of the nodes panel.
How to Use
The node is designed to be flexible, allowing you to apply any supported Lodash function to your input data.
Node Parameters
- Category: First, select the category of the Lodash function you want to use (e.g.,
Array,Object,String). - Function: Based on the selected category, this dropdown will show the available Lodash functions.
- Input Source: Choose where the primary input for the Lodash function comes from:
Full Item: Uses the entire incoming JSON item as input.Specific Field: Uses the value of a specific field from the incoming item.Custom Expression: Uses an n8n expression to define the input.
- Additional Arguments (JSON): Provide any additional arguments required by the Lodash function. The arguments must be formatted as a JSON array. For example, if you are using
_.chunk(array, size), thesizewould be provided here as[2]. - Output Field: Specify the field name where the result of the Lodash function will be stored. Defaults to
result. - Keep Input Data: If enabled, the output field will be merged with the original input item. If disabled, the output will be a new item containing only the result.
Example Workflow
Let's say you have an array in your workflow and you want to split it into smaller chunks using _.chunk().
Input Data:
An upstream node provides the following JSON item:{ "my_array": [1, 2, 3, 4, 5, 6, 7] }Lodash Function Node Configuration:
- Category:
Array - Function:
chunk - Input Source:
Specific Field - Field Name:
my_array - Additional Arguments (JSON):
[3](This is thesizeargument for_.chunk) - Output Field:
chunked_result
- Category:
Output Data:
The node will produce the following output:{ "my_array": [1, 2, 3, 4, 5, 6, 7], "chunked_result": [ [1, 2, 3], [4, 5, 6], [7] ] }
Supported Functions
This node supports a wide variety of Lodash functions, grouped into the following categories directly in the node UI:
- Array
- Collection
- Object
- String
- Number
- Math
- Util
Resources
License
MIT