{
  "name": "Pipedream migration example: new lead webhook to Slack",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-lead",
        "options": {}
      },
      "id": "1a028272-e210-42f1-a09a-7efd4f41fec3",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [0, 0],
      "webhookId": "3ef70781-157d-4339-934a-9ddfe20bb49c"
    },
    {
      "parameters": {
        "jsCode": "// Pipedream: steps.trigger.event.body. n8n: the Webhook node puts the request body in $json.body.\nreturn $input.all().map((item) => {\n  const lead = item.json.body ?? {};\n  const email = String(lead.email ?? '').trim().toLowerCase();\n  const name = String(lead.name ?? '').trim() || 'Unknown';\n  const company = String(lead.company ?? '').trim() || 'n/a';\n  return {\n    json: {\n      email,\n      name,\n      company,\n      slackText: `New lead: ${name} (${email}) from ${company}`,\n    },\n  };\n});"
      },
      "id": "201f42c0-7636-4676-b33f-1bf43d1b47fe",
      "name": "Normalize lead",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [220, 0]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#new-leads",
          "mode": "name"
        },
        "text": "={{ $json.slackText }}",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "id": "bfc129ea-168e-45e9-98ba-6d3f94616946",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [440, 0]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Normalize lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize lead": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}
