Request Mapper

Basic Request Mapper

Overview

The "Request Mapper" node allows users to transform and map input data items by setting or modifying fields according to specified rules. It supports two modes: manual mapping, where fields are edited one by one, and JSON mode, where fields can be set from a JSON object. This node is useful in workflows that require reshaping or enriching data before sending it to other services or nodes.

Common scenarios include:

  • Mapping API response fields to a desired format.
  • Adding or updating specific fields in each item.
  • Filtering or including only certain fields from the input.
  • Preparing data for downstream processing or integration.

For example, you might use this node to rename fields, add calculated values, or remove unwanted fields from incoming data.

Properties

Name Meaning
Mode Choose between "Manual Mapping" (edit fields individually) or "From JSON" (set fields from a JSON object).
Fields to Set In Manual Mapping mode, specify individual field assignments to set or update on each item.
Include Other Input Fields Whether to include all original input fields along with the newly set fields in the output.
Input Fields to Include When including other input fields, select how to filter them: "All", "Selected" fields, or "All Except" some fields.
Fields to Include Comma-separated list of field names to include if "Selected" option is chosen for input fields inclusion.
Fields to Exclude Comma-separated list of field names to exclude if "All Except" option is chosen for input fields inclusion.

Output

The node outputs an array of items where each item contains JSON data representing the transformed fields as per the mapping rules. The output JSON includes:

  • Fields explicitly set or modified by the user.
  • Optionally, other input fields depending on the "Include Other Input Fields" setting and filtering options.

No binary data output is produced by this node.

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

  • Issue: Output missing expected fields.

    • Cause: The "Include Other Input Fields" option may be disabled, or fields are excluded via filters.
    • Resolution: Enable "Include Other Input Fields" or adjust the "Input Fields to Include" settings accordingly.
  • Issue: Fields not updated as expected.

    • Cause: Incorrect field names or assignment syntax in "Fields to Set".
    • Resolution: Verify field names and ensure correct usage of manual mapping or JSON mode.
  • Issue: Errors related to JSON parsing when using "From JSON" mode.

    • Cause: Malformed JSON input.
    • Resolution: Validate JSON syntax before inputting.

Links and References

Discussion