Overview
This node, named "Request Mapper," is designed to transform and map input data items by modifying their fields according to user-defined rules. It supports two modes of operation: manual mapping where fields are edited one by one, and JSON-based mapping where fields can be set from a JSON object.
Common scenarios for this node include:
- Reshaping incoming data to match the expected format of downstream nodes or APIs.
- Adding, updating, or removing specific fields in each item.
- Converting field values to different types such as string, number, boolean, array, or object.
- Filtering output fields by including or excluding certain fields.
Practical examples:
- Mapping raw API response data into a simplified structure with only relevant fields.
- Setting default values or computed values on items before sending them to another service.
- Removing sensitive or unnecessary fields from data before further processing.
Properties
| Name | Meaning |
|---|---|
| Mode | Selects how to edit item fields: Manual Mapping (edit fields individually) or From JSON (edit fields from a JSON object). |
| Fields to Set | Defines the fields to add or modify in the output data. Each field has: - Name: The target field name, supporting dot notation (e.g., data.person[0].name).- Type: The value type ( String, Number, Boolean, Array, Object).- Value: The value to assign, matching the selected type. |
| Fields to Include | Comma-separated list of field names to include in the output. Only these fields will be kept if specified. |
| Fields to Exclude | Comma-separated list of field names to exclude from the output. These fields will be removed if specified. |
Output
The node outputs an array of items where each item's JSON data reflects the applied mappings and filters. The structure of each output item’s json field corresponds to the transformed data after setting fields and applying inclusion/exclusion rules.
If binary data were supported, it would represent attached files or media, but this node focuses solely on JSON data transformation.
Dependencies
- No external services or API keys are required.
- The node relies on internal helper functions (from a bundled executor module) to perform the actual data transformation logic.
- No special environment variables or n8n credentials are needed.
Troubleshooting
- Incorrect field paths: Using invalid dot notation or array indices in field names may cause fields not to be set correctly. Verify field names carefully.
- Type mismatches: Providing values that do not conform to the selected type (e.g., non-numeric string for a Number type) might lead to unexpected results or errors.
- Empty or malformed JSON in "From JSON" mode: Ensure JSON objects are valid and properly formatted.
- Inclusion/Exclusion conflicts: Specifying both include and exclude fields simultaneously may produce confusing outputs; use one at a time for clarity.
- No output changes: If no fields are defined or all fields are excluded, output may appear unchanged or empty.