The Event Alert

    Shared 8/28/2026

    1 views

    Visual Workflow

    JSON Code

    {
      "id": "qP2FMDt7TLJ9Qm9J",
      "meta": {
        "instanceId": "131bec35ac383ea8c561c8f97d49286ad827b69f882ba7c2b7a025cf62fcc9a1",
        "templateCredsSetupCompleted": true
      },
      "name": "The Event Alert",
      "tags": [],
      "nodes": [
        {
          "id": "b91a7d7f-db90-4c38-a020-9b72b0429b4c",
          "name": "Gmail Trigger",
          "type": "n8n-nodes-base.gmailTrigger",
          "position": [
            0,
            0
          ],
          "parameters": {
            "simple": false,
            "filters": {
              "q": "has:attachment"
            },
            "options": {},
            "pollTimes": {
              "item": [
                {
                  "mode": "everyMinute"
                }
              ]
            }
          },
          "credentials": {
            "gmailOAuth2": {
              "id": "nIIlurxPBmadgzvn",
              "name": "Gmail account"
            }
          },
          "typeVersion": 1.4
        },
        {
          "id": "7fbcfab4-426f-4864-a2af-6f5147f4f3d7",
          "name": "AI Agent",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            224,
            0
          ],
          "parameters": {
            "text": "={{ $json.text }}",
            "options": {
              "systemMessage": "You are a business analytics and customer engagement assistant.\n\nYour task is to analyze the provided JSON event data and convert it into **one concise, actionable insight sentence**.\n\n### Rules:\n\n1. Identify the key event, user, plan, acquisition source, and first action from the input.\n2. Rewrite the information naturally rather than simply repeating the JSON.\n3. Highlight meaningful engagement signals or patterns.\n4. If the user's first action indicates strong engagement, explicitly mention it as an engagement signal.\n5. Provide one practical business recommendation based on the event.\n6. Keep the output to **1–2 sentences maximum**.\n7. Do not use bullet points, headings, JSON, markdown, or explanations.\n8. Do not invent information that is not present in the input.\n9. Use a professional but natural business/CRM tone.\n10. When appropriate, use phrases such as \"strong engagement signal\", \"potentially high-intent user\", or \"consider following up\".\n\n### Input:\n\nYou will receive a JSON object containing customer/event information, for example:\n{\n\"event\": \"New signup\",\n\"user_name\": \"Priya Sharma\",\n\"plan\": \"free_trial\",\n\"signup_date\": \"2026-05-12\",\n\"source\": \"Google search\",\n\"first_action\": \"Created a project\"\n}\n\n### Expected output style:\n\nPriya Sharma signed up for a free trial via Google search and immediately created a project — strong engagement signal. Consider sending a personal welcome email within 24 hours.\n\noutput in json format \n{ \"output\":\"\",\"operations_mail\":\"\"}\n"
            },
            "promptType": "define"
          },
          "notesInFlow": false,
          "typeVersion": 3.1,
          "alwaysOutputData": false
        },
        {
          "id": "e5e58dc7-204c-4254-873f-e13067da9412",
          "name": "OpenRouter Chat Model",
          "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
          "position": [
            96,
            192
          ],
          "parameters": {
            "model": "deepseek/deepseek-chat-v3.1",
            "options": {}
          },
          "credentials": {
            "openRouterApi": {
              "id": "gqag05LVqMD6wrfv",
              "name": "OpenRouter account"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "259c8ba6-7310-4989-bd99-1b5ead82f50b",
          "name": "Send a message",
          "type": "n8n-nodes-base.gmail",
          "position": [
            592,
            0
          ],
          "webhookId": "3cbe4480-99b9-42b2-94ea-c1e5594e4f91",
          "parameters": {
            "sendTo": "={{ $json.output.parseJson().operations_mail }}",
            "message": "={{ $json.output }}",
            "options": {},
            "subject": "Operation follow up-{challenge}",
            "emailType": "text"
          },
          "credentials": {
            "gmailOAuth2": {
              "id": "nIIlurxPBmadgzvn",
              "name": "Gmail account"
            }
          },
          "typeVersion": 2.2
        }
      ],
      "active": true,
      "pinData": {},
      "settings": {
        "binaryMode": "separate",
        "executionOrder": "v1"
      },
      "versionId": "b327f9a2-5082-460c-8f72-1a1439bb6923",
      "nodeGroups": [],
      "connections": {
        "AI Agent": {
          "main": [
            [
              {
                "node": "Send a message",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Gmail Trigger": {
          "main": [
            [
              {
                "node": "AI Agent",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "OpenRouter Chat Model": {
          "ai_languageModel": [
            [
              {
                "node": "AI Agent",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        }
      }
    }