Codemation Docs
NodesCore

Map Data

Transform each workflow item into a new JSON shape.

… stars

Map Data

Description

MapData maps each input item to a new output JSON value. Use it to normalize payloads, add derived fields, or prepare data for the next node.

Examples

Basic usage: add a derived status field

new MapData("Mark invoice as ready", (item) => ({
  ...item.json,
  status: "ready",
}));

Example input:

{
  "invoiceId": "inv_42",
  "amount": 799
}

Example output:

{
  "invoiceId": "inv_42",
  "amount": 799,
  "status": "ready"
}

Advanced usage: reshape nested input for downstream APIs

new MapData("Prepare CRM payload", (item) => ({
  customerId: item.json.customer.id,
  customerName: item.json.customer.name,
  total: item.json.invoice.total,
  currency: item.json.invoice.currency,
}));

Example input:

{
  "customer": {
    "id": "cus_9",
    "name": "Acme Corp"
  },
  "invoice": {
    "total": 799,
    "currency": "EUR"
  }
}

Example output:

{
  "customerId": "cus_9",
  "customerName": "Acme Corp",
  "total": 799,
  "currency": "EUR"
}

On this page