{
  "name": "Generate real-time IPL commentary from CricAPI data with GPT-4o",
  "nodes": [
    {
      "id": "99d686e3-4136-4977-8d78-dd2a1ee2dfa0",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -96,
        224
      ]
    },
    {
      "id": "0fd36fb5-fa86-44a9-8937-f7bdad51e668",
      "name": "Manual test trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -80,
        448
      ]
    },
    {
      "id": "f1e1634c-04d0-4fe0-95e8-324eb63fba15",
      "name": "Fetch live match list",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        304
      ]
    },
    {
      "id": "e0437979-34e0-49cc-980d-343bbcb7543e",
      "name": "Narrative Generator",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1008,
        288
      ]
    },
    {
      "id": "fb301e1f-0c26-4ebc-be1c-485e6e8b327d",
      "name": "Compute Match Indicators",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        304
      ]
    },
    {
      "id": "28927d49-279f-4bb2-98dd-bd97c78b8942",
      "name": "Parse Narrative",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        288
      ]
    },
    {
      "id": "c0eb01b1-facc-4e55-84da-fd996880a1be",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1776,
        288
      ]
    },
    {
      "id": "056f77d8-5c13-4219-a2db-24498169ba02",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -144
      ],
      "parameters": {
        "width": 432,
        "height": 592,
        "content": "## Workflow Overview\n\n### How it works\n\nThis workflow turns live IPL match data into \nhuman-sounding win-probability narratives that \nupdate every 6 minutes throughout a match. It \nfetches live scores"
      }
    },
    {
      "id": "7fcf17b7-9101-4fb8-a2c0-add2b9214939",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -16
      ],
      "parameters": {
        "width": 480,
        "height": 656,
        "content": "Two triggers run this workflow. The Schedule Trigger fires automatically every 6 minutes between 2PM and 11PM covering all IPL match windows. The Webhook Trigger lets you fire it manually at any time "
      }
    },
    {
      "id": "2718ebd0-1172-44a8-b581-6d14b884a18b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        176
      ],
      "parameters": {
        "width": 640,
        "height": 336,
        "content": "One API call to CricAPI fetches all current matches. The Code node filters for a live IPL match first — if IPL is not in season it falls back to any live T20 match for testing. It then detects which i"
      }
    },
    {
      "id": "bb963c19-5fe5-42be-a292-d5cfd8c3ef7c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        160
      ],
      "parameters": {
        "width": 608,
        "height": 336,
        "content": "The computed indicators are assembled into a structured prompt and sent to GPT-4o via HTTP Request. The system prompt instructs the model to write exactly 2 sentences, use specific numbers, avoid perc"
      }
    },
    {
      "id": "81e1a1c4-63df-4f14-ad92-507061325a24",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        112
      ],
      "parameters": {
        "width": 496,
        "height": 368,
        "content": "Every narrative is logged with timestamp, match name, innings, over, score, target, RRR, CRR, phase, pressure, and the full narrative text. This creates a complete ball-by-ball record of every narrati"
      }
    },
    {
      "id": "bedb3220-f1de-4716-b741-181a3f691715",
      "name": "Log to IPL Win Probability Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1568,
        288
      ]
    },
    {
      "id": "0b2a28ae-31c0-4c0d-9f28-5ba82a7170ab",
      "name": "Is Live Match ?",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        304
      ]
    }
  ],
  "connections": {
    "Is Live Match ?": {
      "main": [
        [
          {
            "node": "Narrative Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Narrative": {
      "main": [
        [
          {
            "node": "Log to IPL Win Probability Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch live match list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual test trigger": {
      "main": [
        [
          {
            "node": "Fetch live match list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Narrative Generator": {
      "main": [
        [
          {
            "node": "Parse Narrative",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch live match list": {
      "main": [
        [
          {
            "node": "Compute Match Indicators",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute Match Indicators": {
      "main": [
        [
          {
            "node": "Is Live Match ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to IPL Win Probability Log": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}