Request Mapper

Basic Request Mapper

Overview

The node is a Request Mapper designed to transform and modify the data of incoming items by setting or editing fields according to user-defined mappings. It supports two modes: manual field-by-field mapping and JSON-based mapping. This node is useful when you need to reshape, enrich, or filter data before passing it on to other nodes in an n8n workflow.

Common scenarios include:

  • Mapping API response fields to a different structure expected by another service.
  • Adding or modifying specific fields in each item based on static values or expressions.
  • Filtering output fields to include only relevant data for downstream processing.

For example, you might use this node to rename fields from an input dataset, add calculated flags, or remove sensitive information before sending data to a database or external API.

Properties

Name Meaning
Mode Choose between "Manual Mapping" (edit item fields one by one) or "From JSON" (edit item fields from a JSON object).
Fields to Set Define the fields to add or modify in the output. Each field has:
- Name: The target field name (supports dot notation for nested fields).
- Type: Data type of the value (String, Number, Boolean, Array, Object).
- Value: The actual value to set, matching the selected type.
Include in Output Select which input fields to include in the output:
- All Input Fields (include all unchanged fields)
- No Input Fields (only mapped fields)
- Selected Input Fields (include specified fields)
- All Input Fields Except (exclude specified fields)
Fields to Include Comma-separated list of input fields to include when "Selected Input Fields" option is chosen.
Fields to Exclude Comma-separated list of input fields to exclude when "All Input Fields Except" option is chosen.

Output

The node outputs an array of items where each item's json property contains the transformed data after applying the mappings. The structure reflects the modifications defined by the user:

  • Fields added or updated as per the "Fields to Set" configuration.
  • Input fields included or excluded based on the "Include in Output" setting.
  • Supports nested fields using dot notation.

No binary data output is produced by this node; it strictly manipulates JSON data.

Dependencies

  • No external services or API keys are required.
  • The node relies on internal helper modules for execution logic but does not require additional n8n credentials or environment variables.

Troubleshooting

  • Incorrect field names or dot notation: If fields do not appear as expected, verify that field names are correctly spelled and dot notation is properly used for nested objects.
  • Invalid value types: Ensure that the value provided matches the selected type (e.g., number values should be valid numbers).
  • Empty output or missing fields: Check the "Include in Output" setting to confirm whether input fields are included or excluded as intended.
  • JSON parsing errors (in JSON mode): When using the JSON mode, ensure the JSON object syntax is correct and valid.

Links and References

Discussion