{
  "name": "Monitor konkurencji",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {},
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -1088,
        -112
      ],
      "id": "23a97fbc-713f-4fd9-8ecd-5ed6baf82108",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "url": "https://news.google.com/rss/search?q=LEGO+when:1d&hl=pl&gl=PL&ceid=PL:pl",
        "options": {}
      },
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.2,
      "position": [
        -864,
        -112
      ],
      "id": "51acadad-eb33-4557-be83-3759acc476fa",
      "name": "RSS Read"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -640,
        -112
      ],
      "id": "41010e3d-0371-498d-ae9d-5004d4853b60",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "responses": {
          "values": [
            {
              "role": "system",
              "content": "Jesteś analitykiem monitorującym rynek dla firmy zajmującej się produkcją zabawek. Oceniasz, czy poniższy tytuł prasowy jest dla tej firmy istotny. Odpowiadasz wyłącznie jednym słowem: TAK albo NIE. Bez wyjaśnień, bez kropki, bez żadnego dodatkowego tekstu."
            },
            {
              "content": "={{ $json.title }}"
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.3,
      "position": [
        -416,
        -256
      ],
      "id": "364faf85-2b14-4ede-aba8-7a04604c8791",
      "name": "Message a model"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "16ea415d-166e-48a7-b8b9-c9ac3d100703",
              "leftValue": "={{ $json.output[0].content[0].text }}",
              "rightValue": "TAK",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -64,
        -176
      ],
      "id": "22e305a8-4ab9-4405-aa01-cfd9d04a902b",
      "name": "If"
    },
    {
      "parameters": {
        "sendTo": "twoj-adres@example.com",
        "subject": "Monitoring: nowa wiadomość",
        "emailType": "text",
        "message": "={{ $('RSS Read').item.json.title }}\n{{ $('RSS Read').item.json.link }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        160,
        -112
      ],
      "id": "a3685694-64aa-4bd4-9b8f-6bd7dbad85a0",
      "name": "Send a message"
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "RSS Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS Read": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}
