{
  "name": "Find AliExpress affiliate products via Telegram with OpenAI and Decodo",
  "nodes": [
    {
      "id": "7f079fe2-1137-4992-b14e-24330966e124",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1408,
        2304
      ]
    },
    {
      "id": "7a8820af-a1dd-4502-8790-1a38e62ecb48",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        288,
        1824
      ]
    },
    {
      "id": "85cf82ed-c50d-45d6-89b4-aa6cebb7fead",
      "name": "If4",
      "type": "n8n-nodes-base.if",
      "position": [
        512,
        1728
      ]
    },
    {
      "id": "0a32a3b9-0932-47cb-b0ca-61e44f4ee88f",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        2848,
        1552
      ]
    },
    {
      "id": "62406aad-2e3b-4932-8d34-f8700eb031a0",
      "name": "Message a model",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -736,
        1920
      ]
    },
    {
      "id": "3cbbfb07-44a8-4f9a-a6a8-c86dae9a12f1",
      "name": "Code in JavaScript1",
      "type": "n8n-nodes-base.code",
      "position": [
        -384,
        1920
      ]
    },
    {
      "id": "c9f1839f-b180-491a-9f51-26228bc95f80",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -960,
        2304
      ]
    },
    {
      "id": "8011d518-88bb-433a-95ab-43573974da5e",
      "name": "If3",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        2496
      ]
    },
    {
      "id": "d8fe0d8b-7ff0-4c77-a314-6e0c850d4a4d",
      "name": "If5",
      "type": "n8n-nodes-base.if",
      "position": [
        64,
        2400
      ]
    },
    {
      "id": "f4dbed57-121b-4463-a09b-0d83f03cd37a",
      "name": "Code in JavaScript2",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        2016
      ]
    },
    {
      "id": "d1e2148e-9ab9-4ffc-a3e5-bb467ef9945c",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -160,
        2784
      ]
    },
    {
      "id": "82046f73-87a9-4da1-8832-b0617aa4f573",
      "name": "Bot start filtering",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1184,
        2304
      ]
    },
    {
      "id": "3f3c75e7-ad7a-4145-89e7-cf5916d81a8f",
      "name": "Only if the person who asked for more is the one who sent the original message",
      "type": "n8n-nodes-base.if",
      "position": [
        -672,
        2592
      ]
    },
    {
      "id": "c7376207-9f53-45ef-9edd-2a2740a47d02",
      "name": "Checking if we are in a certain group ",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        2496
      ]
    },
    {
      "id": "75ccd5b9-417c-421b-88d5-7be5cd1b5ca5",
      "name": "A message that only those who sent an original message can request more",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        2784
      ]
    },
    {
      "id": "37a48993-9c0e-4095-84b6-3c36cf219a07",
      "name": "Deleting a message 5",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        2784
      ]
    },
    {
      "id": "01b27dcf-804c-4aab-bba2-c4c12fcbc6d3",
      "name": "Request to join the group 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        2592
      ]
    },
    {
      "id": "c6d082da-c47b-4c0c-9ac4-83e7b14e1798",
      "name": "Opening message 2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        288,
        2304
      ]
    },
    {
      "id": "24431c33-dfa4-456a-89c4-81b3a2e392ca",
      "name": "Request for correct wording 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        288,
        2496
      ]
    },
    {
      "id": "834b00e0-dbb4-4d01-8c86-3e77a904acd7",
      "name": "Start typing 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        512,
        2304
      ]
    },
    {
      "id": "431ed356-fc49-477f-a389-057f32a1fe67",
      "name": "Creating a professional search term 1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        736,
        2304
      ]
    },
    {
      "id": "e9b00b13-53c6-4e5b-a9a4-dfe0e78137b5",
      "name": "Data scraping1",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        1088,
        2304
      ]
    },
    {
      "id": "658b00e2-f47b-43cc-b41d-22502ef6562f",
      "name": "Follow-up message 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1376,
        2304
      ]
    },
    {
      "id": "074ad2a5-755a-41a0-bcd1-96fd62de9ad5",
      "name": "Extracting all items 1",
      "type": "n8n-nodes-base.code",
      "position": [
        1664,
        2304
      ]
    },
    {
      "id": "6938c765-3340-4956-8e87-53a51b8449b6",
      "name": "Creating an affiliate link",
      "type": "n8n-nodes-aliexpress-affiliate.aliExpressAffiliate",
      "position": [
        2112,
        2016
      ]
    },
    {
      "id": "addbff58-332b-4c08-ade4-df0dabc350b7",
      "name": "If there is an error or not 1",
      "type": "n8n-nodes-base.if",
      "position": [
        2560,
        2304
      ]
    },
    {
      "id": "d705d739-bdb7-46d6-b568-a292cdeebffb",
      "name": "Wording for message",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2784,
        2304
      ]
    },
    {
      "id": "12e0b047-b8df-4186-a962-29125ac5e8af",
      "name": "Sending a message 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3136,
        2304
      ]
    },
    {
      "id": "9267fb15-8614-49b2-8a91-4c6e63dd0072",
      "name": "Deleting a message 3",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3424,
        2304
      ]
    },
    {
      "id": "723e38f4-2f62-4a8b-bf4d-b11db13e3ded",
      "name": "Deleting a message4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3712,
        2304
      ]
    },
    {
      "id": "b9fa5bab-d9f3-4a2d-8409-8de510da428a",
      "name": "If there is problematic content",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        1920
      ]
    },
    {
      "id": "c16fc16a-21a5-4b60-98bc-24137be6edf6",
      "name": "Checking if we are in a certain group",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        1824
      ]
    },
    {
      "id": "a5bd1973-89ba-4efa-8c44-e9b6c1120a35",
      "name": "Request to join the group",
      "type": "n8n-nodes-base.telegram",
      "position": [
        512,
        1920
      ]
    },
    {
      "id": "5f066203-bc0d-47ff-9a39-1ed9018d8803",
      "name": "opening message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        800,
        1632
      ]
    },
    {
      "id": "7031bd59-85d7-41e0-b9b9-08c2cf425f84",
      "name": "Start typing",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1088,
        1632
      ]
    },
    {
      "id": "106782f8-fc58-4b5c-8db0-9587b2f1d95b",
      "name": "Request for correct wording",
      "type": "n8n-nodes-base.telegram",
      "position": [
        800,
        1920
      ]
    },
    {
      "id": "b6ba7019-d442-4e49-a736-236b4d1526b2",
      "name": "Creating a professional search term",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1312,
        1632
      ]
    },
    {
      "id": "f5251536-43e5-4089-b676-fcc5207dc82c",
      "name": "data scraping",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        1664,
        1632
      ]
    },
    {
      "id": "089d8ed5-b24b-4e83-805d-c2ec92c25435",
      "name": "Follow up message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1888,
        1632
      ]
    },
    {
      "id": "820651a3-f443-4493-8663-456b1ce0a8f9",
      "name": "Extract all items",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        1632
      ]
    },
    {
      "id": "ae1b3a0f-d25c-4bb4-8885-b27fc4886629",
      "name": "Extraction of 2 products from the first 10",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        1552
      ]
    },
    {
      "id": "96daa4fa-4c06-427c-bd6a-5fb3bf9c43c5",
      "name": "Extraction of 2 products from the first 7",
      "type": "n8n-nodes-base.code",
      "position": [
        1888,
        2016
      ]
    },
    {
      "id": "c7d97f05-445e-41ae-bc1d-4a7937cf0780",
      "name": "Opening message 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        2112
      ]
    },
    {
      "id": "a38f5fb9-50f8-404e-b12b-37c9652f46be",
      "name": "Deleting a message 2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        288,
        2112
      ]
    },
    {
      "id": "169222c2-5cb7-4967-9a0a-b73d19862518",
      "name": "Automatic removal of the user from the group",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        512,
        2112
      ]
    },
    {
      "id": "350e8e76-441e-4d66-acd5-9ddd0da50817",
      "name": "Creating an affiliate link3",
      "type": "n8n-nodes-aliexpress-affiliate.aliExpressAffiliate",
      "position": [
        2560,
        1552
      ]
    },
    {
      "id": "d9b68d3c-78d6-43f7-b314-0788ab3a37ce",
      "name": "whether there is an error or not",
      "type": "n8n-nodes-base.if",
      "position": [
        3136,
        1632
      ]
    },
    {
      "id": "b48378b9-6993-4bbd-b4da-5173e8c9f823",
      "name": "Wording for message 3",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3360,
        1632
      ]
    },
    {
      "id": "4af3fdcc-99bc-41ed-98ff-90aeae52633a",
      "name": "sending a message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3712,
        1632
      ]
    },
    {
      "id": "a35465aa-56a1-450d-98c1-2b5f320180c7",
      "name": "Deleting a message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3936,
        1632
      ]
    },
    {
      "id": "ecfadf5e-db27-469a-9845-51750d01ad2a",
      "name": "Deleting a message 1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4160,
        1632
      ]
    },
    {
      "id": "5088b848-be9b-40d3-b219-728b8fec9a6e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        1440
      ],
      "parameters": {
        "width": 528,
        "height": 608,
        "content": "# AliExpress Affiliate Bot for Telegram\n\nAutomatically find and share AliExpress products with affiliate links in your Telegram group.\n\n## How it works\n1. Bot receives messages and callback queries fr"
      }
    },
    {
      "id": "613c5d55-a79e-40c3-9a74-2eb25845ffda",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1472,
        2176
      ],
      "parameters": {
        "width": null,
        "height": 112,
        "content": "📥 Input Handler\nReceives incoming messages and callback queries from Telegram."
      }
    },
    {
      "id": "538075c1-6781-4171-bc8e-0b94848ecaae",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        1792
      ],
      "parameters": {
        "width": null,
        "height": 112,
        "content": "🛡️ Content Moderation\nAI validates message content. Blocks spam, links, and inappropriate requests."
      }
    },
    {
      "id": "74e555fb-230c-4d5e-bd39-17f42b19c803",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        1504
      ],
      "parameters": {
        "width": null,
        "height": 112,
        "content": "🔍 Product Search\nTranslates request to search query and scrapes AliExpress for products."
      }
    },
    {
      "id": "03bf3077-af92-44e2-9b71-1670b4104f60",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2496,
        1424
      ],
      "parameters": {
        "width": null,
        "height": 112,
        "content": "🔗 Affiliate Link Generation\nCreates tracking links via AliExpress API. Handles errors gracefully."
      }
    },
    {
      "id": "6513c4da-8e00-48fc-90d1-424c82b2ab1a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3360,
        1504
      ],
      "parameters": {
        "width": null,
        "height": 112,
        "content": "📤 Response Handler\nSends product cards to Telegram and cleans up temporary messages."
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Only if the person who asked for more is the one who sent the original message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "If4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request to join the group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If3": {
      "main": [
        [
          {
            "node": "If5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request to join the group 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If4": {
      "main": [
        [
          {
            "node": "opening message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request for correct wording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If5": {
      "main": [
        [
          {
            "node": "Opening message 2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request for correct wording 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Deleting a message 5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start typing": {
      "main": [
        [
          {
            "node": "Creating a professional search term",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "data scraping": {
      "main": [
        [
          {
            "node": "Follow up message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data scraping1": {
      "main": [
        [
          {
            "node": "Follow-up message 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start typing 1": {
      "main": [
        [
          {
            "node": "Creating a professional search term 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "opening message": {
      "main": [
        [
          {
            "node": "Start typing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Bot start filtering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract all items": {
      "main": [
        [
          {
            "node": "Extraction of 2 products from the first 10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Follow up message": {
      "main": [
        [
          {
            "node": "Extract all items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Opening message 1": {
      "main": [
        [
          {
            "node": "Deleting a message 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Opening message 2": {
      "main": [
        [
          {
            "node": "Start typing 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sending a message": {
      "main": [
        [
          {
            "node": "Deleting a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "whether there is an error or not",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deleting a message": {
      "main": [
        [
          {
            "node": "Deleting a message 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bot start filtering": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "If there is problematic content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript2": {
      "main": [
        [
          {
            "node": "If there is an error or not 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Follow-up message 1": {
      "main": [
        [
          {
            "node": "Extracting all items 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sending a message 1": {
      "main": [
        [
          {
            "node": "Deleting a message 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wording for message": {
      "main": [
        [
          {
            "node": "Sending a message 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deleting a message 2": {
      "main": [
        [
          {
            "node": "Automatic removal of the user from the group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deleting a message 3": {
      "main": [
        [
          {
            "node": "Deleting a message4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wording for message 3": {
      "main": [
        [
          {
            "node": "sending a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extracting all items 1": {
      "main": [
        [
          {
            "node": "Extraction of 2 products from the first 7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creating an affiliate link": {
      "main": [
        [
          {
            "node": "Code in JavaScript2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creating an affiliate link3": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If there is an error or not 1": {
      "main": [
        [
          {
            "node": "Wording for message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extracting all items 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If there is problematic content": {
      "main": [
        [
          {
            "node": "Checking if we are in a certain group",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Opening message 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "whether there is an error or not": {
      "main": [
        [
          {
            "node": "Wording for message 3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract all items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creating a professional search term": {
      "main": [
        [
          {
            "node": "data scraping",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Checking if we are in a certain group": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creating a professional search term 1": {
      "main": [
        [
          {
            "node": "Data scraping1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Checking if we are in a certain group ": {
      "main": [
        [
          {
            "node": "If3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extraction of 2 products from the first 7": {
      "main": [
        [
          {
            "node": "Creating an affiliate link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extraction of 2 products from the first 10": {
      "main": [
        [
          {
            "node": "Creating an affiliate link3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "A message that only those who sent an original message can request more": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only if the person who asked for more is the one who sent the original message": {
      "main": [
        [
          {
            "node": "Checking if we are in a certain group ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "A message that only those who sent an original message can request more",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}