> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Map Keys

> Rename or move property paths within an object.

The **Map Keys** action copies an object, then applies a repeatable set of
old-path to new-path mappings. Each mapping moves the value to its new location
and removes the old path.

## Inputs

| Input            | Type            | Required  | Description                               |
| ---------------- | --------------- | --------- | ----------------------------------------- |
| **Object**       | Object          | Yes       | The object whose paths will be changed.   |
| **Key Mappings** | Mapping entries | No        | Old and new path pairs, applied in order. |
| **Old Key**      | String          | Per entry | The existing key or nested path.          |
| **New Key**      | String          | Per entry | The destination key or nested path.       |

## Outputs

| Output     | Type   | Description                            |
| ---------- | ------ | -------------------------------------- |
| **Result** | Object | A copied object with mappings applied. |

## Rename and restructure

Given:

```json theme={null}
{
  "first_name": "Ada",
  "contact": { "email": "ada@example.com" }
}
```

Map `first_name` to `name` and `contact.email` to `customer.email`:

```json theme={null}
{
  "name": "Ada",
  "contact": {},
  "customer": { "email": "ada@example.com" }
}
```

Dot and bracket notation are supported for both paths. A missing old path is
skipped.

<Warning>
  Mappings run in order and can overwrite an existing destination. A later
  mapping also sees the changes made by earlier mappings, so avoid chains and
  overlapping paths unless that sequence is intentional.
</Warning>
