Reference · Tools

Rename Keys

Update item field names — supports dot-notation for nested fields and regex-based bulk renaming.

Action Core Nodes v1

Rename Keys changes field names on items, either by direct mapping or with regex patterns, and understands dot-notation for nested fields. It needs no credentials. A typical build is normalising the differing field names from two source systems before merging their data.

Node type
Action
Parameters
3
Outputs
Output, Error
Credentials
None required

Rename Keys

Rename item field names

Overview

The Rename Keys tool renames properties/fields in item JSON data. It supports two modes: (1) Direct key mapping with dot-notation for nested paths (e.g., level1.level2.oldKey → level1.level2.newKey), and (2) Regex-based bulk renaming with depth control, case-insensitive matching, and capture group replacement.

Category: Core Nodes
Tool Name: rename_keys
Version: 1

Appearance: Icon: lucide-Replace | Color: #772244

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool does not require any credentials.

Parameters

ParameterTypeRequiredDefaultDescription
KeysfixedCollectionNo{}Adds a key which should be renamed. Accepts multiple entries, applied in the order you list them.
— Current Key NamestringNoThe current name of the key. Supports dot-notation for nested paths (e.g., “level1.level2.currentKey”).
— New Key NamestringNoThe new name for the key. Supports dot-notation for nested paths (e.g., “level1.level2.newKey”).
Additional OptionscollectionNo{}Bulk renaming by pattern, applied after the direct renames above.
— RegexfixedCollectionNo{}Adds a regular expression for bulk key renaming. Accepts multiple entries.
— — Regular ExpressionstringNoRegex to match the key name.
— — Replace WithstringNoThe replacement string. Supports regex captures ($1, $2, etc.).
— — OptionscollectionNo{}Matching settings for this one expression.
— — — Case InsensitivebooleanNofalseWhether to use case insensitive match.
— — — Max DepthnumberNo-1Maximum depth to replace keys (-1 for unlimited, 0 for top level only).
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One output item per input item, with the same values under new names. The item is copied and rewritten, so nothing else changes: values, types and nesting are untouched, and binary data is forwarded.

Renaming runs in two passes:

  1. Keys — each Current Key Name is looked up (dot-notation walks into nested objects), removed, and written back at New Key Name. An entry is skipped when either name is empty, when both names are identical, or when the field is not present on the item — a missing field is never an error.
  2. Regex — every entry in Additional Options → Regex is applied to the key names themselves. A key that matches is replaced using the expression, so ^temp_(.+)$ with final_$1 turns temp_total into final_total. Matching is case-sensitive unless Case Insensitive is on, and Max Depth limits how far into nested objects the rename descends (0 = top level only, -1 = the whole item). Array indices are never renamed, but the objects inside arrays are still visited.

Because both passes rewrite key names, downstream expressions must use the new names, e.g. {{ $json.first_name }}.

Usage Examples

  • Rename “firstName” to “first_name” using direct mapping
  • Use regex to strip prefixes from all field names
  • Rename nested fields using dot-notation paths

Example Configuration

Rename two fields:

{
  "type": "rename_keys",
  "parameters": {
    "maxConcurrency": 5,
    "keys": {
      "key": [
        {
          "currentKey": "email_address",
          "newKey": "email"
        },
        {
          "currentKey": "phone_number",
          "newKey": "phone"
        }
      ]
    }
  }
}

Rename a nested field with dot-notation:

{
  "type": "rename_keys",
  "parameters": {
    "keys": {
      "key": [
        {
          "currentKey": "user.profile.displayName",
          "newKey": "user.profile.name"
        }
      ]
    }
  }
}

Strip a prefix from every matching key, two levels deep:

{
  "type": "rename_keys",
  "parameters": {
    "additionalOptions": {
      "regexReplacement": {
        "replacements": [
          {
            "searchRegex": "^temp_(.+)$",
            "replaceRegex": "final_$1",
            "options": {
              "caseInsensitive": true,
              "depth": 2
            }
          }
        ]
      }
    }
  }
}

Combine a direct rename with a bulk pattern:

{
  "type": "rename_keys",
  "parameters": {
    "maxConcurrency": 10,
    "keys": {
      "key": [
        {
          "currentKey": "id",
          "newKey": "recordId"
        }
      ]
    },
    "additionalOptions": {
      "regexReplacement": {
        "replacements": [
          {
            "searchRegex": "^temp_(.+)$",
            "replaceRegex": "$1",
            "options": {
              "caseInsensitive": true,
              "depth": 3
            }
          }
        ]
      }
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Renames item field names using direct key mapping or regex patterns with dot-notation support.

Behavior notes

  • Direct renames run before regex renames. A regex written against the original key name will not match if a Keys entry already renamed that field.
  • A rename that lands on an existing key overwrites it. Check for collisions before renaming several fields onto similar names.
  • Dot-notation is the default. A key that genuinely contains a dot in its name has to be reached with a regex instead, since the direct mapping treats the dot as a path separator.

Frequently asked questions

In what order do the two rename styles run?

Direct renames run before regex renames. A regex written against the original key name will not match if a Keys entry has already renamed that field — a subtle ordering trap worth knowing.

What happens if a rename collides with an existing key?

It overwrites it. Check for collisions before renaming several fields onto similar names, since the overwritten value is simply gone.

How do I rename a key that genuinely contains a dot?

Dot-notation is the default, so a key containing a literal dot needs handling accordingly rather than being treated as a nested path.

Does it need credentials?

No — it reshapes data already in the workflow.

Build with the Rename Keys node

Drop it into a workflow, wire it to an agent, or call it on a schedule.

Open BusyBot

Last updated . Spotted something wrong? Tell us.