{
  "name": "Generate IPL post‑match and weekly email analyses with GPT‑4o, CricAPI and Gmail",
  "nodes": [
    {
      "id": "612a7a89-f2d6-43e4-9e51-f99308c05f49",
      "name": "Every 30 Min Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "3f6aaa7c-3229-4701-b9ef-232b7e7b4227",
      "name": "Read Match Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        464,
        0
      ]
    },
    {
      "id": "3654c841-7996-40cf-bc57-01ba62365759",
      "name": "Find New Completed IPL Match",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        0
      ]
    },
    {
      "id": "030e9e80-e8ba-4b60-a7e7-93d33a2b7369",
      "name": "Fetch Recent Matches",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        0
      ]
    },
    {
      "id": "fbe37132-dcc0-4a61-a570-fb0f67708272",
      "name": "Save to Match Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1168,
        -16
      ]
    },
    {
      "id": "4bced3d8-5bcf-4c12-baee-895c9a8f92c3",
      "name": "Weekly Monday 9AM Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        80,
        768
      ]
    },
    {
      "id": "f28ccf08-53d4-46ce-8782-eb6ca2b80216",
      "name": "Read Analysis Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        288,
        768
      ]
    },
    {
      "id": "e681ec41-e244-47f3-903f-f49cfaa6f99f",
      "name": "Build Weekly Digest Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        496,
        768
      ]
    },
    {
      "id": "029d18a8-ff0d-435b-9d6f-95b0b46dc942",
      "name": "Weekly Journalist",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1040,
        752
      ]
    },
    {
      "id": "54999499-3144-49cc-bd1e-645515ae10e8",
      "name": "Parse & Build Weekly Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1392,
        752
      ]
    },
    {
      "id": "2fec8592-672f-405d-ae0f-68d7539a22e7",
      "name": "Send Weekly Digest",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1696,
        752
      ]
    },
    {
      "id": "2c8fb2a5-332d-45ac-a27c-b8e37df7d66a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        -528
      ],
      "parameters": {
        "width": 400,
        "height": 544,
        "content": "## Workflow Overview\n\n### How It Works\nEvery IPL match tells a story that the scoreboard \nalone cannot capture. This workflow automatically \ndetects completed IPL matches, fetches the full \nscorecard,"
      }
    },
    {
      "id": "4a87cd3f-6c93-461a-97ba-d2a6feed9e8b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -192
      ],
      "parameters": {
        "width": 1504,
        "height": 400,
        "content": "Match Completion Detector runs every 30 minutes and polls CricAPI for recently completed T20 matches. It reads the Match Log sheet to check which matches have already been analyzed and finds any new c"
      }
    },
    {
      "id": "61664b7a-0574-4a05-bc18-63d81cd41b57",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        256
      ],
      "parameters": {
        "width": 1504,
        "height": 288,
        "content": "This flow receives the completed match data and builds a structured analytical prompt containing both innings stats, run rates, and result context. GPT-4o acts as a cricket analyst and produces a head"
      }
    },
    {
      "id": "4b2a3526-aaf2-4208-9227-490b59573367",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        608
      ],
      "parameters": {
        "width": 1872,
        "height": 352,
        "content": "Weekly Digest runs every Monday at 9AM. It reads all match analyses from the past 7 days in the Analysis Log sheet and sends them to GPT-4o which generates a weekly roundup — a headline, match recaps,"
      }
    },
    {
      "id": "7b2d03dc-3fe0-444f-b7c0-383ab7f52eb0",
      "name": "IF Matches This Week",
      "type": "n8n-nodes-base.if",
      "position": [
        704,
        768
      ]
    },
    {
      "id": "4badffe7-6af0-4ec3-bf9e-ff4a2eb90c31",
      "name": "IF New Match Found",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        0
      ]
    },
    {
      "id": "042debc4-f746-4160-be19-a20e55081f83",
      "name": "Send Analysis Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1744,
        368
      ]
    },
    {
      "id": "dde48779-b714-462a-9fd7-3f5d500fa10a",
      "name": "Log to Analysis Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2192,
        368
      ]
    },
    {
      "id": "78d66cec-e495-4b95-bf3e-33c2c234a73f",
      "name": "Update Match Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1968,
        368
      ]
    },
    {
      "id": "5784097b-e1d2-476e-b2c9-08f1a4071e9c",
      "name": "Parse Analysis & Build Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1520,
        368
      ]
    },
    {
      "id": "199a16b3-d2ba-4e21-b067-3b176811c78e",
      "name": "Match Analyst",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1168,
        368
      ]
    },
    {
      "id": "191a93d8-8b59-423e-aea7-1c2793d1fabf",
      "name": "Build Analysis Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        944,
        368
      ]
    }
  ],
  "connections": {
    "Match Analyst": {
      "main": [
        [
          {
            "node": "Parse Analysis & Build Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Match Log": {
      "main": [
        [
          {
            "node": "Find New Completed IPL Match",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Match Log": {
      "main": [
        [
          {
            "node": "Log to Analysis Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Analysis Log": {
      "main": [
        [
          {
            "node": "Build Weekly Digest Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Journalist": {
      "main": [
        [
          {
            "node": "Parse & Build Weekly Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF New Match Found": {
      "main": [
        [
          {
            "node": "Save to Match Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Analysis Email": {
      "main": [
        [
          {
            "node": "Update Match Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 30 Min Trigger": {
      "main": [
        [
          {
            "node": "Fetch Recent Matches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Recent Matches": {
      "main": [
        [
          {
            "node": "Read Match Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Matches This Week": {
      "main": [
        [
          {
            "node": "Weekly Journalist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Analysis Prompt": {
      "main": [
        [
          {
            "node": "Match Analyst",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Monday 9AM Trigger": {
      "main": [
        [
          {
            "node": "Read Analysis Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Weekly Digest Prompt": {
      "main": [
        [
          {
            "node": "IF Matches This Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse & Build Weekly Email": {
      "main": [
        [
          {
            "node": "Send Weekly Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find New Completed IPL Match": {
      "main": [
        [
          {
            "node": "IF New Match Found",
            "type": "main",
            "index": 0
          },
          {
            "node": "Build Analysis Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Analysis & Build Email": {
      "main": [
        [
          {
            "node": "Send Analysis Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}