{
  "name": "Lead intake -> CRM -> SMS (sample with typical production issues)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead-intake",
        "responseMode": "onReceived"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        200,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://api.example-crm.com/v1/contacts?api_key=sk-live-EXAMPLEKEY000000000000000000",
        "method": "POST",
        "jsonParameters": true,
        "bodyParametersJson": "={{ JSON.stringify($json.body) }}"
      },
      "name": "Create CRM contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const lead = items[0].json;\nreturn [{ json: { phone: lead.phone, first: lead.first_name } }];"
      },
      "name": "Shape for SMS",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        700,
        300
      ]
    },
    {
      "parameters": {
        "batchSize": 1
      },
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        950,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://api.twilio.com/2010-04-01/Accounts/ACxxx/Messages.json",
        "method": "POST",
        "authentication": "genericCredentialType"
      },
      "name": "Send SMS",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1200,
        300
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "name": "Nightly re-sync (old)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        200,
        600
      ],
      "disabled": true
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Create CRM contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create CRM contact": {
      "main": [
        [
          {
            "node": "Shape for SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shape for SMS": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Send SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {}
}