{
  "name": "Web Form Submission to Telegram Alert",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "form-to-telegram",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "tfsa0001-0001-4000-8000-000000000001",
      "name": "Receive Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "field1",
              "name": "name",
              "value": "={{ $json.body.name ?? $json.body.full_name ?? 'Unknown' }}",
              "type": "string"
            },
            {
              "id": "field2",
              "name": "email",
              "value": "={{ $json.body.email ?? '' }}",
              "type": "string"
            },
            {
              "id": "field3",
              "name": "message",
              "value": "={{ $json.body.message ?? $json.body.content ?? '' }}",
              "type": "string"
            },
            {
              "id": "field4",
              "name": "submittedAt",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "tfsa0001-0002-4000-8000-000000000002",
      "name": "Extract Form Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [460, 300]
    },
    {
      "parameters": {
        "chatId": "={{ $env.TELEGRAM_NOTIFY_CHAT_ID }}",
        "text": "=📬 *New Form Submission*\\n\\n*Name:* {{ $json.name }}\\n*Email:* {{ $json.email }}\\n*Message:* {{ $json.message }}\\n\\n_Received: {{ $json.submittedAt }}_",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "id": "tfsa0001-0003-4000-8000-000000000003",
      "name": "Send Telegram Alert",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "field1",
              "name": "status",
              "value": "received",
              "type": "string"
            },
            {
              "id": "field2",
              "name": "timestamp",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "tfsa0001-0004-4000-8000-000000000004",
      "name": "Respond with Confirmation",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [900, 300]
    }
  ],
  "connections": {
    "Receive Form Webhook": {
      "main": [[{ "node": "Extract Form Fields", "type": "main", "index": 0 }]]
    },
    "Extract Form Fields": {
      "main": [[{ "node": "Send Telegram Alert", "type": "main", "index": 0 }]]
    },
    "Send Telegram Alert": {
      "main": [[{ "node": "Respond with Confirmation", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
