{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "Legacy sync — remap & tidy fields",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Legacy record",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": {
          "CUST_NM": "Acme Corp",
          "CUST_EMAIL": "ops@acme.test",
          "REGION_CD": "W",
          "LEGACY_FLAG": "Y"
        }
      },
      "position": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "remap",
      "type": "processing.map-fields",
      "label": "Map to new schema",
      "category": "processing",
      "config": {
        "mappings": {
          "name": "CUST_NM",
          "email": "CUST_EMAIL",
          "region": "REGION_CD"
        }
      },
      "position": {
        "x": 530,
        "y": 0
      }
    },
    {
      "id": "tidy",
      "type": "processing.modify",
      "label": "Stamp & strip",
      "category": "processing",
      "config": {
        "mode": "merge",
        "assignments": [
          {
            "name": "syncedAt",
            "value": "{{ $now }}",
            "type": "auto"
          },
          {
            "name": "source",
            "value": "legacy-crm",
            "type": "string"
          }
        ],
        "rename": [],
        "remove": [
          "LEGACY_FLAG"
        ],
        "keepOnly": []
      },
      "position": {
        "x": 1060,
        "y": 0
      }
    },
    {
      "id": "out",
      "type": "utility.console",
      "label": "New CRM shape",
      "category": "utility",
      "config": {
        "message": "Synced: {{ $json }}"
      },
      "position": {
        "x": 1590,
        "y": 0
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "remap",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "remap",
      "sourcePort": "output",
      "targetNodeId": "tidy",
      "targetPort": "input"
    },
    {
      "id": "e2",
      "sourceNodeId": "tidy",
      "sourcePort": "output",
      "targetNodeId": "out",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "A record from the legacy CRM lands with old field names: Map Fields pulls them into the new shape, then Modify stamps the sync status and strips the leftovers."
  }
}