{
  "name": "Send women’s safety emergency alerts with GPT-4o-mini, Telegram and Google Sheets",
  "nodes": [
    {
      "id": "7df819ef-3d27-43ab-a390-281eb39a5cd1",
      "name": "Sticky Note: Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -576
      ],
      "parameters": {
        "width": 640,
        "height": 528,
        "content": "## 🚨 Women's Safety Emergency Alert System\n\n### How it works\nWhen a safety app or button sends a POST request to this webhook, the workflow immediately extracts the person's name, phone number, and GP"
      }
    },
    {
      "id": "1774a9ae-48df-48e6-8632-a8787402149d",
      "name": "Sticky Note: Webhook",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        16
      ],
      "parameters": {
        "width": 348,
        "height": 380,
        "content": "## 📡 Webhook Trigger\nReceives an emergency POST request from a safety app or panic button. Expects `name`, `phone`, `lat`, and `lng` in the body. This is the only entry point — nothing runs until this"
      }
    },
    {
      "id": "73d826e7-5251-4d19-9239-a22ca9144058",
      "name": "Sticky Note: Data Prep",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        16
      ],
      "parameters": {
        "width": 424,
        "height": 374,
        "content": "## 🗺️ Data Preparation\nExtracts the incoming fields, builds a Google Maps link from the GPS coordinates, and assembles a timestamped message (IST timezone). These two steps prepare all the data before"
      }
    },
    {
      "id": "d238ecb3-5fbc-492f-8758-917fe7219752",
      "name": "Sticky Note: AI Formatting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -48
      ],
      "parameters": {
        "width": 472,
        "height": 630,
        "content": "## 🤖 AI Alert Formatting\nPasses the structured data to GPT-4o-mini, which formats a concise, emoji-tagged emergency alert. The prompt enforces a strict output format so the Telegram message is always "
      }
    },
    {
      "id": "251ec537-0572-4c28-b2c9-6e19acb6f1a9",
      "name": "Sticky Note: Dispatch & Logging",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -176
      ],
      "parameters": {
        "width": 428,
        "height": 790,
        "content": "## 📬 Alert Dispatch & Logging\nThe formatted alert fires to both destinations simultaneously: a Telegram group for immediate human response, and a Google Sheet for a permanent incident record with name"
      }
    },
    {
      "id": "38fc1764-6dbc-451b-8ab1-91d270e93437",
      "name": "Sticky Note: Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        320
      ],
      "parameters": {
        "width": 308,
        "height": 194,
        "content": "## 🔐 Credentials & Security\nUse OAuth2 for Google Sheets. Store Telegram and OpenAI keys as named n8n credentials — never paste tokens directly into nodes. Replace all sheet and chat IDs before sharin"
      }
    },
    {
      "id": "641e795b-b72d-4ec6-8064-c5e0f9217602",
      "name": "Receive Emergency Alert",
      "type": "n8n-nodes-base.webhook",
      "position": [
        80,
        208
      ]
    },
    {
      "id": "0297c8d3-f1ee-4994-86ba-4a0ff17decd7",
      "name": "Generate Maps Link",
      "type": "n8n-nodes-base.function",
      "position": [
        368,
        208
      ]
    },
    {
      "id": "c1056bb8-f60d-4c3e-bded-0a0003e1776d",
      "name": "Build Timestamped Message",
      "type": "n8n-nodes-base.function",
      "position": [
        608,
        208
      ]
    },
    {
      "id": "a04b3537-464e-4d31-88d0-10b4ab4ea9f1",
      "name": "AI Agent: Format Emergency Alert",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        912,
        208
      ]
    },
    {
      "id": "d838e1a4-1cdb-4f69-8215-611c5699fe80",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        848,
        432
      ]
    },
    {
      "id": "d82e5023-5f3d-4a66-bf74-09afff500adc",
      "name": "Send Alert to Telegram Group",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1424,
        48
      ]
    },
    {
      "id": "02d8f456-0d3a-4f5b-9d82-1c224fef2649",
      "name": "Log Incident to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1424,
        320
      ]
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Format Emergency Alert",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Maps Link": {
      "main": [
        [
          {
            "node": "Build Timestamped Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Emergency Alert": {
      "main": [
        [
          {
            "node": "Generate Maps Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Timestamped Message": {
      "main": [
        [
          {
            "node": "AI Agent: Format Emergency Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Format Emergency Alert": {
      "main": [
        [
          {
            "node": "Send Alert to Telegram Group",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Incident to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}