{
  "name": "Sainsbury - Research Analyst",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -620,
        -180
      ],
      "id": "8be9c5f8-17eb-47db-9625-e75584819d8a",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "content": "![](https://static.wikia.nocookie.net/longhorn/images/2/2b/Sainsbury%27s_2013.svg/revision/latest?cb=20181016054553)\n# A team of AI agents that does competitive research on Tesco, Asda & Morrisons for Sainsbury",
        "height": 400,
        "width": 2200,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -680
      ],
      "typeVersion": 1,
      "id": "43dfd227-148e-4b06-82c9-18d47963f735",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "40bf6862-e775-4c8b-b752-707b6aedfd60",
              "leftValue": "={{ $json.pubDate }}",
              "rightValue": "={{ $('Max Article Date').item.json.maxDate }}",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        220,
        -180
      ],
      "id": "ff42f48c-e320-4a26-ad9f-302dbbbfc3c5",
      "name": "Log If Data is New"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nlet maxDate = new Date(0); // Start with the earliest possible date\n\nitems.forEach(item => {\n    const pubDate = new Date(item.json.pubDate); // Access the pubDate field\n    if (pubDate > maxDate) {\n        maxDate = pubDate; // Update maxDate if the current pubDate is greater\n    }\n});\n\nreturn [{ json: { maxDate: maxDate.toISOString() } }]; // Return the maximum date"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -200,
        -180
      ],
      "id": "92eecc7a-aed8-4248-9b07-8d1bf8a66a10",
      "name": "Max Article Date"
    },
    {
      "parameters": {
        "html": "={{ $json.bodyContent }}",
        "options": {}
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [
        220,
        20
      ],
      "id": "23293b38-d41c-4236-9fdd-46e8059e33d7",
      "name": "Markdown",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -620,
        20
      ],
      "id": "afb904dd-baa7-4234-ae6e-909739d6c4e4",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "content": "## Tesco Research",
        "height": 580,
        "width": 2200,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -280
      ],
      "typeVersion": 1,
      "id": "9babdbcb-293a-4faf-a165-aab1cadddd90",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Asda Research",
        "height": 580,
        "width": 2200,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        300
      ],
      "typeVersion": 1,
      "id": "1441db7c-5e1a-45d5-8657-393b1fbf3001",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Morrisons Research",
        "height": 580,
        "width": 2200,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        880
      ],
      "typeVersion": 1,
      "id": "02923591-94c0-43af-85db-24ac65625486",
      "name": "Sticky Note3",
      "disabled": true
    },
    {
      "parameters": {
        "url": "https://www.google.com/alerts/feeds/01556086680926105660/13752867445221829726",
        "options": {
          "ignoreSSL": false
        }
      },
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        0,
        -180
      ],
      "id": "101917ab-756b-4482-ae69-f243b6734a28",
      "name": "Signals Tesco"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "competitor",
              "lookupValue": "Tesco"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -420,
        -180
      ],
      "id": "ce80042a-29e2-4d62-9d6f-ea5668a0c638",
      "name": "Get All Tesco",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=I need you to map what this article is talking about, to  one of these 8 topics\n topics = [\n    \"Financial Performance\",\n    \"Customer Experience\",\n    \"Market Positioning\",\n    \"Product Innovations\",\n    \"Technological Trends\",\n    \"Regulatory Changes\",\n    \"Sales and Marketing Strategies\",\n    \"Industry Trends\"\n]\n\nHere is the article Summary\n {{ $json.message.content }}\n\nONLY RESPOND with a SINGLE value from topics array"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        820,
        20
      ],
      "id": "e0e56422-be44-4700-8c1d-2eac3264d327",
      "name": "Classification Tesco",
      "credentials": {
        "openAiApi": {
          "id": "Rx1s3A8TvKYO1Xbw",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=# Summarize this page using only PLAIN TEXT\n\n {{ $json.bodyContent }}\n\n## Rules\n- DO NOT format this this.\n- DO NOT use Markdown\n- DO NOT use HTML\n- USE ONLY plain text"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        440,
        20
      ],
      "id": "ce7c3122-2395-42ee-91fa-4956274b9bc4",
      "name": "Summarize Tesco",
      "credentials": {
        "openAiApi": {
          "id": "Rx1s3A8TvKYO1Xbw",
          "name": "OpenAi account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "// Hardcoded Google redirect URL\nconst redirectUrl = $input.first().json.link;\n\n// Function to extract the real URL from a Google redirect\nfunction extractRealUrl(redirectUrl) {\n    const regex = /[?&]url=([^&]+)/;\n    const match = redirectUrl.match(regex);\n    return match ? decodeURIComponent(match[1]) : null;\n}\n\n// Extract the real URL\nconst realUrl = extractRealUrl(redirectUrl);\n\n// Return the real URL in output\nreturn [{ json: { realUrl } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -400,
        20
      ],
      "id": "f3cddfb7-47ea-4774-9f55-88334bc98632",
      "name": "Custom Code  - Extract URL"
    },
    {
      "parameters": {
        "url": "={{ $json.realUrl }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -180,
        20
      ],
      "id": "4f09ea5d-5cc8-4439-b2bf-c1f95b8fce94",
      "name": "Get Article",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "// Get the HTML input from n8n\nconst htmlContent = $input.first().json.data;\n\n// Function to extract content within <body> tags\nfunction extractBodyContent(html) {\n    const bodyRegex = /<body[^>]*>([\\s\\S]*?)<\\/body>/i;\n    const match = html.match(bodyRegex);\n    return match ? match[1].trim() : null; // Return trimmed content or null if no match\n}\n\n// Extract body content\nconst bodyContent = extractBodyContent(htmlContent);\n\n// Return the body content in the output\nreturn [{ json: { bodyContent } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        20,
        20
      ],
      "id": "d0c7d36b-a095-4502-9df6-2ae5d26d8e46",
      "name": "Custom Code - Extract Body",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "pubDate": "={{ $('Signals Tesco').item.json.pubDate.toDateTime().format('MM-dd-yy hh:mm a') }}",
            "title": "={{ $('Signals Tesco').item.json.title.replace(/<[^>]*>/g, '') }}",
            "content": "={{ $('Signals Tesco').item.json.content.replace(/<[^>]*>/g, '') }}",
            "link": "={{ $('Custom Code  - Extract URL').item.json.realUrl }}",
            "competitor": "Tesco",
            "classification": "={{ $json.message.content }}",
            "Summary": "={{ $('Summarize Tesco').item.json.message.content }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "competitor",
              "displayName": "competitor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "pubDate",
              "displayName": "pubDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "classification",
              "displayName": "classification",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "displayName": "content",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "link",
              "displayName": "link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "displayName": "Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1220,
        20
      ],
      "id": "d0b7e2ac-d2e5-4af6-9430-8f65f778f4af",
      "name": "Google Sheets1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "40bf6862-e775-4c8b-b752-707b6aedfd60",
              "leftValue": "={{ $json.pubDate }}",
              "rightValue": "={{ $('Max Article Date1').item.json.maxDate }}",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        240,
        420
      ],
      "id": "f8a838a7-899b-4039-93da-a1c2b251a600",
      "name": "Log If Data is New1"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nlet maxDate = new Date(0); // Start with the earliest possible date\n\nitems.forEach(item => {\n    const pubDate = new Date(item.json.pubDate); // Access the pubDate field\n    if (pubDate > maxDate) {\n        maxDate = pubDate; // Update maxDate if the current pubDate is greater\n    }\n});\n\nreturn [{ json: { maxDate: maxDate.toISOString() } }]; // Return the maximum date"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -180,
        420
      ],
      "id": "80709f03-d1fd-4b02-906e-14da57d6c6a5",
      "name": "Max Article Date1"
    },
    {
      "parameters": {
        "html": "={{ $json.bodyContent }}",
        "options": {}
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [
        240,
        620
      ],
      "id": "158a9a6f-c190-4251-8b63-16aba30cd5c4",
      "name": "Markdown1",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -600,
        620
      ],
      "id": "9eafb66f-0e5b-4de3-aab7-147ce965f129",
      "name": "Loop Over Items1"
    },
    {
      "parameters": {
        "jsCode": "// Hardcoded Google redirect URL\nconst redirectUrl = $input.first().json.link;\n\n// Function to extract the real URL from a Google redirect\nfunction extractRealUrl(redirectUrl) {\n    const regex = /[?&]url=([^&]+)/;\n    const match = redirectUrl.match(regex);\n    return match ? decodeURIComponent(match[1]) : null;\n}\n\n// Extract the real URL\nconst realUrl = extractRealUrl(redirectUrl);\n\n// Return the real URL in output\nreturn [{ json: { realUrl } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -380,
        620
      ],
      "id": "e6e24066-ec11-4a0c-834b-e536f9933313",
      "name": "Custom Code  - Extract URL1"
    },
    {
      "parameters": {
        "url": "={{ $json.realUrl }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -160,
        620
      ],
      "id": "9d9bf1ae-81b4-4286-98cb-88be75363d84",
      "name": "Get Article1",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "// Get the HTML input from n8n\nconst htmlContent = $input.first().json.data;\n\n// Function to extract content within <body> tags\nfunction extractBodyContent(html) {\n    const bodyRegex = /<body[^>]*>([\\s\\S]*?)<\\/body>/i;\n    const match = html.match(bodyRegex);\n    return match ? match[1].trim() : null; // Return trimmed content or null if no match\n}\n\n// Extract body content\nconst bodyContent = extractBodyContent(htmlContent);\n\n// Return the body content in the output\nreturn [{ json: { bodyContent } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        40,
        620
      ],
      "id": "4a754484-cabf-4079-b49d-b92d7dcef766",
      "name": "Custom Code - Extract Body1",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "pubDate": "={{ $('Signals Asda').item.json.pubDate.toDateTime().format('MM-dd-yy hh:mm a') }}",
            "title": "={{ $('Signals Asda').item.json.title.replace(/<[^>]*>/g, '') }}",
            "content": "={{ $('Signals Asda').item.json.content.replace(/<[^>]*>/g, '') }}",
            "link": "={{ $('Custom Code  - Extract URL1').item.json.realUrl }}",
            "competitor": "Asda",
            "classification": "={{ $json.message.content }}",
            "Summary": "={{ $('Summarize Asda').item.json.message.content }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "competitor",
              "displayName": "competitor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "pubDate",
              "displayName": "pubDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "classification",
              "displayName": "classification",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "displayName": "content",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "link",
              "displayName": "link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "displayName": "Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1240,
        620
      ],
      "id": "17ae9c0d-02b4-496c-8299-6596b0e660b3",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "url": "https://www.google.com/alerts/feeds/01556086680926105660/9910986285403594098",
        "options": {
          "ignoreSSL": false
        }
      },
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        20,
        420
      ],
      "id": "c0b2eee4-70d1-41bf-9941-c84ba2d6fd57",
      "name": "Signals Asda"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=# Summarize this page using only PLAIN TEXT\n\n {{ $json.bodyContent }}\n\n## Rules\n- DO NOT format this this.\n- DO NOT use Markdown\n- DO NOT use HTML\n- USE ONLY plain text"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        460,
        620
      ],
      "id": "27434a41-4b44-49e0-96c4-25a84f069620",
      "name": "Summarize Asda",
      "credentials": {
        "openAiApi": {
          "id": "Rx1s3A8TvKYO1Xbw",
          "name": "OpenAi account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=I need you to map what this article is talking about, to  one of these 8 topics\n topics = [\n    \"Financial Performance\",\n    \"Customer Experience\",\n    \"Market Positioning\",\n    \"Product Innovations\",\n    \"Technological Trends\",\n    \"Regulatory Changes\",\n    \"Sales and Marketing Strategies\",\n    \"Industry Trends\"\n]\n\nHere is the article Summary\n {{ $json.message.content }}\n\nONLY RESPOND with a SINGLE value from topics array"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        840,
        620
      ],
      "id": "2efe123c-02dd-4676-bba5-860d19cd6159",
      "name": "Classification Asda",
      "credentials": {
        "openAiApi": {
          "id": "Rx1s3A8TvKYO1Xbw",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "40bf6862-e775-4c8b-b752-707b6aedfd60",
              "leftValue": "={{ $json.pubDate }}",
              "rightValue": "={{ $('Max Article Date2').item.json.maxDate }}",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        220,
        1000
      ],
      "id": "d914e234-a1a3-4d61-bbfd-156a07229055",
      "name": "Log If Data is New2"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nlet maxDate = new Date(0); // Start with the earliest possible date\n\nitems.forEach(item => {\n    const pubDate = new Date(item.json.pubDate); // Access the pubDate field\n    if (pubDate > maxDate) {\n        maxDate = pubDate; // Update maxDate if the current pubDate is greater\n    }\n});\n\nreturn [{ json: { maxDate: maxDate.toISOString() } }]; // Return the maximum date"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -200,
        1000
      ],
      "id": "ac6857d4-1927-4a51-98a3-c4fe229b739d",
      "name": "Max Article Date2"
    },
    {
      "parameters": {
        "html": "={{ $json.bodyContent }}",
        "options": {}
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [
        220,
        1200
      ],
      "id": "36b9eb85-39e1-4a2a-99bb-1904dc14dabc",
      "name": "Markdown2",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -620,
        1200
      ],
      "id": "3766a827-40a6-4482-87df-26b16b2ef62b",
      "name": "Loop Over Items2"
    },
    {
      "parameters": {
        "jsCode": "// Hardcoded Google redirect URL\nconst redirectUrl = $input.first().json.link;\n\n// Function to extract the real URL from a Google redirect\nfunction extractRealUrl(redirectUrl) {\n    const regex = /[?&]url=([^&]+)/;\n    const match = redirectUrl.match(regex);\n    return match ? decodeURIComponent(match[1]) : null;\n}\n\n// Extract the real URL\nconst realUrl = extractRealUrl(redirectUrl);\n\n// Return the real URL in output\nreturn [{ json: { realUrl } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -400,
        1200
      ],
      "id": "720a693a-49d6-42d7-a16f-61dbf4038f12",
      "name": "Custom Code  - Extract URL2"
    },
    {
      "parameters": {
        "url": "={{ $json.realUrl }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -180,
        1200
      ],
      "id": "50716536-f4ea-4345-b335-9c0c91afa7f1",
      "name": "Get Article2",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "// Get the HTML input from n8n\nconst htmlContent = $input.first().json.data;\n\n// Function to extract content within <body> tags\nfunction extractBodyContent(html) {\n    const bodyRegex = /<body[^>]*>([\\s\\S]*?)<\\/body>/i;\n    const match = html.match(bodyRegex);\n    return match ? match[1].trim() : null; // Return trimmed content or null if no match\n}\n\n// Extract body content\nconst bodyContent = extractBodyContent(htmlContent);\n\n// Return the body content in the output\nreturn [{ json: { bodyContent } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        20,
        1200
      ],
      "id": "8698fbc2-0757-462a-94a4-d5c2cf7f7f26",
      "name": "Custom Code - Extract Body2",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "pubDate": "={{ $('Signals Morrisons').item.json.pubDate.toDateTime().format('MM-dd-yy hh:mm a') }}",
            "title": "={{ $('Signals Morrisons').item.json.title.replace(/<[^>]*>/g, '') }}",
            "content": "={{ $('Signals Morrisons').item.json.content.replace(/<[^>]*>/g, '') }}",
            "link": "={{ $('Custom Code  - Extract URL2').item.json.realUrl }}",
            "competitor": "Morrisons ",
            "classification": "={{ $json.message.content }}",
            "Summary": "={{ $('Summarize Morrisons').item.json.message.content }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "competitor",
              "displayName": "competitor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "pubDate",
              "displayName": "pubDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "classification",
              "displayName": "classification",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "displayName": "content",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "link",
              "displayName": "link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "displayName": "Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1220,
        1200
      ],
      "id": "7668cc03-171c-4ca7-bb2a-573885459e34",
      "name": "Google Sheets2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=I need you to map what this article is talking about, to  one of these 8 topics\n topics = [\n    \"Financial Performance\",\n    \"Customer Experience\",\n    \"Market Positioning\",\n    \"Product Innovations\",\n    \"Technological Trends\",\n    \"Regulatory Changes\",\n    \"Sales and Marketing Strategies\",\n    \"Industry Trends\"\n]\n\nHere is the article Summary\n {{ $json.message.content }}\n\nONLY RESPOND with a SINGLE value from topics array"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        820,
        1200
      ],
      "id": "317dfb32-3a7f-4fb3-80db-ccc523e45379",
      "name": "Classification Morrisons",
      "credentials": {
        "openAiApi": {
          "id": "Rx1s3A8TvKYO1Xbw",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=# Summarize this page using only PLAIN TEXT\n\n {{ $json.bodyContent }}\n\n## Rules\n- DO NOT format this this.\n- DO NOT use Markdown\n- DO NOT use HTML\n- USE ONLY plain text"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        440,
        1200
      ],
      "id": "64c6fe73-8900-470d-8247-d22aa79cf403",
      "name": "Summarize Morrisons",
      "credentials": {
        "openAiApi": {
          "id": "Rx1s3A8TvKYO1Xbw",
          "name": "OpenAi account"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "competitor",
              "lookupValue": "Morrisons "
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -420,
        1000
      ],
      "id": "ab25c0bd-310f-4c41-be74-2f5d7adf23d7",
      "name": "Get All Morrisons",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "url": "https://www.google.com/alerts/feeds/01556086680926105660/9129736925979848083",
        "options": {
          "ignoreSSL": false
        }
      },
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        0,
        1000
      ],
      "id": "4f96bd1b-bc98-4803-8cc9-ac52f9472a02",
      "name": "Signals Morrisons"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "competitor",
              "lookupValue": "Asda"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -400,
        420
      ],
      "id": "47766f1b-d24b-4250-9087-9dd13755f734",
      "name": "Get All Asda",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -600,
        420
      ],
      "id": "216b3e5b-eec3-492d-9e96-b846afc2a45c",
      "name": "Schedule Trigger1"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -620,
        1000
      ],
      "id": "7573f1c8-4820-4422-b1f5-263d522a1173",
      "name": "Schedule Trigger2"
    },
    {
      "parameters": {
        "content": "# [Powered By - Google Alerts)](https://www.google.com/alerts)\n## [Data](https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=sharing) | [Chat UI](https://auto.cnxlab.us/webhook/fb1fa435-cc96-41c4-a590-091e5a154934/chat) | [Chat Engine](https://auto.cnxlab.us/workflow/lgtAiGWkFOrzjijz)",
        "height": 120,
        "width": 520,
        "color": 2
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -560
      ],
      "typeVersion": 1,
      "id": "399c50dd-bb0c-4479-83d4-df1cf17cbb8f",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "1385d9d6-d494-479c-b11d-4335cc3d2dfe",
              "leftValue": "={{ $json.pubDate }}",
              "rightValue": "={{ $('2 weeks in the past').item.json['Older Than Date'] }}",
              "operator": {
                "type": "dateTime",
                "operation": "before"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        20,
        1580
      ],
      "id": "99f3d5a1-2ad1-43c6-a41c-ffd8fa35d7d0",
      "name": "Filter"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "bdceb23a-4da9-4984-a04f-815355ec5d34",
              "name": "Older Than Date",
              "value": "={{ $now.minus(1, 'weeks') }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -420,
        1580
      ],
      "id": "554921b3-3929-4b93-af1a-24eca1e7758a",
      "name": "2 weeks in the past"
    },
    {
      "parameters": {
        "amount": 3
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        700,
        1600
      ],
      "id": "aed34d5d-a630-4e20-81f2-8f4eccea3fea",
      "name": "Wait",
      "webhookId": "7a4b816d-586d-421b-9fde-09f87395cd5b"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -200,
        1580
      ],
      "id": "835dc02e-9086-49b0-b8e3-d9c423cef38f",
      "name": "Google Sheets3",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        240,
        1580
      ],
      "id": "97e07dd0-426e-4f2a-b79d-ec88d2f4fb06",
      "name": "Loop Over Items3"
    },
    {
      "parameters": {
        "operation": "delete",
        "documentId": {
          "__rl": true,
          "value": "1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM",
          "mode": "list",
          "cachedResultName": "Sainsbury",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "NewsData",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aPcl4de4lF9rjj25Q6EaACuU9SnU-O10fotO6_TW_PM/edit#gid=0"
        },
        "startIndex": "={{ $json.row_number }}"
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        480,
        1600
      ],
      "id": "8cec6b55-2fdc-435a-b4d3-619a6b6b6300",
      "name": "Google Sheets4",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "bU61ktbu2gExR1dP",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "content": "# 🗑️Rolling 1 Week Pruning",
        "height": 400,
        "width": 2200,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        1460
      ],
      "typeVersion": 1,
      "id": "1e1bd26d-bb44-4056-b8ac-78f783781c69",
      "name": "Sticky Note5",
      "disabled": true
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -640,
        1580
      ],
      "id": "6c48f8f9-0f92-4031-a81d-8523d1e36487",
      "name": "Schedule Trigger3"
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get All Tesco",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log If Data is New": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Max Article Date": {
      "main": [
        [
          {
            "node": "Signals Tesco",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "Summarize Tesco",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Custom Code  - Extract URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Signals Tesco": {
      "main": [
        [
          {
            "node": "Log If Data is New",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Tesco": {
      "main": [
        [
          {
            "node": "Max Article Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Tesco": {
      "main": [
        [
          {
            "node": "Classification Tesco",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Code  - Extract URL": {
      "main": [
        [
          {
            "node": "Get Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Article": {
      "main": [
        [
          {
            "node": "Custom Code - Extract Body",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Code - Extract Body": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classification Tesco": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log If Data is New1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Max Article Date1": {
      "main": [
        [
          {
            "node": "Signals Asda",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown1": {
      "main": [
        [
          {
            "node": "Summarize Asda",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [],
        [
          {
            "node": "Custom Code  - Extract URL1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Code  - Extract URL1": {
      "main": [
        [
          {
            "node": "Get Article1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Article1": {
      "main": [
        [
          {
            "node": "Custom Code - Extract Body1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Code - Extract Body1": {
      "main": [
        [
          {
            "node": "Markdown1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Signals Asda": {
      "main": [
        [
          {
            "node": "Log If Data is New1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Asda": {
      "main": [
        [
          {
            "node": "Classification Asda",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classification Asda": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log If Data is New2": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Max Article Date2": {
      "main": [
        [
          {
            "node": "Signals Morrisons",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown2": {
      "main": [
        [
          {
            "node": "Summarize Morrisons",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [],
        [
          {
            "node": "Custom Code  - Extract URL2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Code  - Extract URL2": {
      "main": [
        [
          {
            "node": "Get Article2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Article2": {
      "main": [
        [
          {
            "node": "Custom Code - Extract Body2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Custom Code - Extract Body2": {
      "main": [
        [
          {
            "node": "Markdown2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classification Morrisons": {
      "main": [
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Morrisons": {
      "main": [
        [
          {
            "node": "Classification Morrisons",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Morrisons": {
      "main": [
        [
          {
            "node": "Max Article Date2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Signals Morrisons": {
      "main": [
        [
          {
            "node": "Log If Data is New2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Asda": {
      "main": [
        [
          {
            "node": "Max Article Date1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger2": {
      "main": [
        [
          {
            "node": "Get All Morrisons",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Get All Asda",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2 weeks in the past": {
      "main": [
        [
          {
            "node": "Google Sheets3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets3": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items3": {
      "main": [
        [],
        [
          {
            "node": "Google Sheets4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets4": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger3": {
      "main": [
        [
          {
            "node": "2 weeks in the past",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "027ede46-2d74-44be-9ac1-03930898a168",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "26112711d1e602538e53f9bd5e1222f080991c0315f0a70671e9e769f2503e86"
  },
  "id": "2K8ziUYXq1h2aMtV",
  "tags": []
}