{
  "name": "Generate live cricket score commentary using SerpAPI, GPT-4o-mini, and Telegram",
  "nodes": [
    {
      "id": "3e221697-8448-4bbf-a0ca-f5b0633a188a",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        -528
      ],
      "parameters": {
        "width": 568,
        "height": 508,
        "content": "## 🏏 Live Cricket Score Commentator Bot\n\n### How it works\nThis workflow runs every 10 seconds, fetches live cricket scores for India matches via SerpAPI, extracts the latest match details, and passes "
      }
    },
    {
      "id": "de46536d-6e46-4868-a60d-b704efe2f81c",
      "name": "Section: Trigger & Fetch",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        32
      ],
      "parameters": {
        "width": 444,
        "height": 336,
        "content": "## ⏱ Trigger & Live Data Fetch\nFires every 10 seconds and queries Google (via SerpAPI) for real-time India cricket scores. Adjust the interval or search query here if you want less frequent updates or"
      }
    },
    {
      "id": "f468336d-08f2-4b8e-bb92-d71aa4011aac",
      "name": "Section: Extract & Validate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        32
      ],
      "parameters": {
        "width": 492,
        "height": 352,
        "content": "## 🔍 Extract & Validate Match Data\nParses the raw SerpAPI response to pull the latest match — team names, scores, result, and tournament. The `If` node skips execution entirely when no match result is"
      }
    },
    {
      "id": "afd2786f-f8d9-4c42-b657-5b4903f847b9",
      "name": "Section: AI Agent",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -32
      ],
      "parameters": {
        "width": 412,
        "height": 592,
        "content": "## 🤖 AI Commentary Generator\nThe AI Agent uses GPT-4o-mini to turn raw match data into a structured, expert-tone summary — covering match result, key turning point, standout performer, and a tactical "
      }
    },
    {
      "id": "f2eb33f4-603f-428c-88ea-7c8256ba7e11",
      "name": "Section: Deliver & Alert",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -80
      ],
      "parameters": {
        "width": 476,
        "height": 608,
        "content": "## 📲 Deliver & Alert\nOn success, the formatted commentary is sent to a Telegram chat using Markdown. On AI failure, a Gmail alert is dispatched so you can follow up manually. A separate error trigger "
      }
    },
    {
      "id": "b65bc9ad-253a-491e-9a52-509e21f411ef",
      "name": "Section: Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        608
      ],
      "parameters": {
        "width": 316,
        "height": 178,
        "content": "## 🔐 Credentials & Security\nUse named credentials for SerpAPI, OpenAI, Telegram, Gmail, and Slack. Never hardcode API keys or tokens directly in node parameters. Replace any personal emails or workspa"
      }
    },
    {
      "id": "61929665-a8d0-4b0d-a585-1f84618bd41c",
      "name": "Every 10 Seconds Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -224,
        176
      ]
    },
    {
      "id": "fae55871-defa-40ff-8a21-23e64bba1757",
      "name": "Fetch Live Cricket Score",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        0,
        176
      ]
    },
    {
      "id": "acb3f5de-5a8a-45f7-8186-88a73a75996c",
      "name": "Extract Latest Match Data",
      "type": "n8n-nodes-base.function",
      "position": [
        272,
        176
      ]
    },
    {
      "id": "e6a0650c-be4a-4ee5-a999-9d9e4c5ab015",
      "name": "Skip If No Match Result",
      "type": "n8n-nodes-base.if",
      "position": [
        544,
        176
      ]
    },
    {
      "id": "9b255df1-17f5-42f0-8296-4ad41ef760f3",
      "name": "Generate AI Match Commentary",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        864,
        160
      ]
    },
    {
      "id": "cd50b514-305e-4adc-85cc-4f5cf006a671",
      "name": "OpenAI GPT-4o-mini Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        784,
        384
      ]
    },
    {
      "id": "d8f10921-8829-449b-a5db-8a91b151ba5c",
      "name": "Send Commentary to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1376,
        64
      ]
    },
    {
      "id": "ead4ae8c-4ab3-4482-84f7-6cb7109c943b",
      "name": "Email Alert on AI Failure",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1360,
        368
      ]
    },
    {
      "id": "21a02a10-b4b1-4867-a160-998534f49f91",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        608
      ],
      "parameters": {
        "width": 492,
        "height": 400,
        "content": "## ⚠️ Error Monitoring\n\nCatches any workflow failures and sends alerts to Slack's general-information channel. Helps maintain reliability and enables quick troubleshooting."
      }
    },
    {
      "id": "99937587-f311-4ee3-b5d9-7e349849def2",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -288,
        800
      ]
    },
    {
      "id": "e5e83fef-991d-477d-ab16-b82e82809037",
      "name": "Alert on Workflow Failure",
      "type": "n8n-nodes-base.slack",
      "position": [
        -32,
        800
      ]
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Alert on Workflow Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip If No Match Result": {
      "main": [
        [
          {
            "node": "Generate AI Match Commentary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 10 Seconds Trigger": {
      "main": [
        [
          {
            "node": "Fetch Live Cricket Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Live Cricket Score": {
      "main": [
        [
          {
            "node": "Extract Latest Match Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4o-mini Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate AI Match Commentary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Email Alert on AI Failure": {
      "main": [
        [
          {
            "node": "Fetch Live Cricket Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Latest Match Data": {
      "main": [
        [
          {
            "node": "Skip If No Match Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Match Commentary": {
      "main": [
        [
          {
            "node": "Send Commentary to Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Email Alert on AI Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}