{
  "name": "CredIQ \u2014 Loan Application Notification",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "crediq-loan",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "d4e5f6a7-b8c9-0123-defa-444444444444",
      "name": "Webhook: Loan Applied",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json.body || $input.first().json;\nreturn [{\n  json: {\n    notification: `\ud83c\udfe6 New Loan Application \u2014 CredIQ\\nProduct: ${data.loanType}\\nProvider: ${data.provider}\\nAmount: \u20b9${Number(data.amount).toLocaleString('en-IN')}\\nCredScore: ${data.score}/850\\nTime: ${new Date().toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' })}`,\n    ...data\n  }\n}];"
      },
      "id": "e5f6a7b8-c9d0-1234-efab-555555555555",
      "name": "Format Loan Notification",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "from": "+14155238886",
        "to": "+916238046005",
        "toWhatsapp": true,
        "body": "={{ $json.notification }}"
      },
      "id": "a1b2c3d4-loan-twil-io00-000000000001",
      "name": "WhatsApp: Loan Alert",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        680,
        300
      ],
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "{ \"status\": \"application_received\" }"
      },
      "id": "f6a7b8c9-d0e1-2345-fabc-666666666666",
      "name": "Respond to CredIQ",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        900,
        300
      ]
    }
  ],
  "connections": {
    "Webhook: Loan Applied": {
      "main": [
        [
          {
            "node": "Format Loan Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Loan Notification": {
      "main": [
        [
          {
            "node": "WhatsApp: Loan Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp: Loan Alert": {
      "main": [
        [
          {
            "node": "Respond to CredIQ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "CredIQ"
    }
  ],
  "meta": {
    "templateCredsSetupCompleted": true
  }
}