{
  "name": "Agent lead scrap information company",
  "nodes": [
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        120,
        -20
      ],
      "id": "9a9cd33f-7f85-4e42-a493-5acef3e45e5e",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA",
          "mode": "list",
          "cachedResultName": "\u041b\u0438\u0434\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "lookupValue": "0"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        320,
        -20
      ],
      "id": "d9492f4d-0106-4dbb-baf7-59210b1e656f",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "maxItems": 10
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        540,
        -20
      ],
      "id": "7629c0a2-46de-4012-bc04-a25fd66853ff",
      "name": "Limit"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        520,
        280
      ],
      "id": "5b0f8708-7d42-4419-968f-3d5fde84418f",
      "name": "Loop Over Items",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "url": "={{ $json[\"\u0421\u0430\u0439\u0442\"] }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        740,
        280
      ],
      "id": "fb6d5322-2b97-4c88-aa2a-09466ce07425",
      "name": "HTTP Request",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430\nconst cleanText = $json.cleanText;\n\n// \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 email\nconst emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.(?!png|jpg|gif|jpeg)[a-zA-Z]{2,}/g;\n\n// \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 (\u0420\u043e\u0441\u0441\u0438\u044f)\nconst phoneRegex = /(?:\\+7|8|7|\\(\\d{3}\\))[\\s\\-()]*\\d{3}[\\s\\-()]*\\d{2}[\\s\\-()]*\\d{2}|(?:\\+7|8|7)?[\\s\\-()]*\\d{3}[\\s\\-()]*\\d{3}[\\s\\-()]*\\d{2}[\\s\\-()]*\\d{2}/g;\n\n// \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c email\nconst emails = cleanText.match(emailRegex) || [];\n\n// \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b\nconst phones = cleanText.match(phoneRegex) || [];\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn {\n  json: {\n    emails: emails,\n    phones: phones\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1200,
        280
      ],
      "id": "b39f97c0-a244-44bb-bdc1-ed9f5249af5c",
      "name": "Code"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA",
          "mode": "list",
          "cachedResultName": "\u041b\u0438\u0434\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f": "={{ $json.companyName_3 }}",
            "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438": "={{ $json.description_3 }}",
            "\u041f\u043e\u0447\u0442\u0430": "={{ $json.emailsString_2 }}",
            "\u0422\u0435\u043b\u0435\u0444\u043e\u043d": "={{ $json.phonesString_4 }}",
            "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445": "1",
            "\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438": "={{ $json.automationOpportunities_3 }}",
            "\u0421\u0430\u0439\u0442": "={{ $json[\"\u0421\u0430\u0439\u0442_1\"] }}",
            "\u0420\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438": "={{ $json.analysis_3 }}"
          },
          "matchingColumns": [
            "\u0421\u0430\u0439\u0442"
          ],
          "schema": [
            {
              "id": "\u0421\u0430\u0439\u0442",
              "displayName": "\u0421\u0430\u0439\u0442",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f",
              "displayName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041f\u043e\u0447\u0442\u0430",
              "displayName": "\u041f\u043e\u0447\u0442\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0422\u0435\u043b\u0435\u0444\u043e\u043d",
              "displayName": "\u0422\u0435\u043b\u0435\u0444\u043e\u043d",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
              "displayName": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "displayName": "\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "\u0420\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "displayName": "\u0420\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0438\u0441\u044c\u043c\u0430",
              "displayName": "\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0438\u0441\u044c\u043c\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430",
              "displayName": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "displayName": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1600,
        660
      ],
      "id": "46855256-e3c9-4388-a4a1-aae36faa96c5",
      "name": "Google Sheets1",
      "alwaysOutputData": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "72d2cb98-e420-473f-bb1b-20be3e478e84",
              "name": "true",
              "value": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u0445 \u043f\u043e \u0441\u0430\u0439\u0442\u0430\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u0430, \u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit?gid=0#gid=0",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        120,
        1400
      ],
      "id": "b7cce5a2-0a60-48f5-9ea5-06c88811142b",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "content": "## \u0426\u0438\u043a\u043b \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0430\u0439\u0442\u043e\u0432",
        "height": 1040,
        "width": 1700,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        80,
        220
      ],
      "id": "99f98b29-c273-48c7-baf8-0dc896c3808e",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430",
        "height": 240,
        "width": 300,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        80,
        1320
      ],
      "id": "90fce740-8e02-4bc6-9d3f-c27dc89fb4a3",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443",
        "height": 260,
        "width": 620,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        80,
        -100
      ],
      "id": "3b8d8723-d37e-4de7-b773-014f01bb2ce2",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA",
          "mode": "list",
          "cachedResultName": "\u041b\u0438\u0434\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "\u0421\u0430\u0439\u0442": "={{ $('Loop Over Items').item.json[\"\u0421\u0430\u0439\u0442\"] }}",
            "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445": "={{ $json.error.message }}"
          },
          "matchingColumns": [
            "\u0421\u0430\u0439\u0442"
          ],
          "schema": [
            {
              "id": "\u0421\u0430\u0439\u0442",
              "displayName": "\u0421\u0430\u0439\u0442",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f",
              "displayName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041f\u043e\u0447\u0442\u0430",
              "displayName": "\u041f\u043e\u0447\u0442\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0422\u0435\u043b\u0435\u0444\u043e\u043d",
              "displayName": "\u0422\u0435\u043b\u0435\u0444\u043e\u043d",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
              "displayName": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0438\u0441\u044c\u043c\u0430",
              "displayName": "\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0438\u0441\u044c\u043c\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430",
              "displayName": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "displayName": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        300,
        280
      ],
      "id": "a2636be3-3c10-4233-b106-8a5072d1990b",
      "name": "Google Sheets2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "qwen/qwen-plus",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        140,
        980
      ],
      "id": "aaaac51a-7d01-4761-a302-3536352400b2",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u0422\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430: {{ $('Edit Fields1').item.json.cleanText }}",
        "messages": {
          "messageValues": [
            {
              "message": "=\u0422\u042b \u2014 \u0412\u042b\u0421\u041e\u041a\u041e\u041a\u041b\u0410\u0421\u0421\u041d\u042b\u0419 \u042d\u041a\u0421\u041f\u0415\u0420\u0422 \u041f\u041e \u0411\u0418\u0417\u041d\u0415\u0421-\u0410\u0412\u0422\u041e\u041c\u0410\u0422\u0418\u0417\u0410\u0426\u0418\u0418 \u0418 \u0418\u041d\u0422\u0415\u0413\u0420\u0410\u0426\u0418\u0418 \u0418\u0418-\u0420\u0415\u0428\u0415\u041d\u0418\u0419. \u0422\u0412\u041e\u042f \u0417\u0410\u0414\u0410\u0427\u0410 \u2014 \u0413\u0415\u041d\u0415\u0420\u0418\u0420\u041e\u0412\u0410\u0422\u042c \u041a\u041e\u041c\u041f\u0410\u041a\u0422\u041d\u042b\u0415 \u041e\u041f\u0418\u0421\u0410\u041d\u0418\u042f \u041a\u041e\u041c\u041f\u0410\u041d\u0418\u0419 (\u041d\u0415 \u0411\u041e\u041b\u0415\u0415 300 \u0421\u0418\u041c\u0412\u041e\u041b\u041e\u0412), \u041e\u0422\u0420\u0410\u0416\u0410\u042e\u0429\u0418\u0415 \u0418\u0425 \u0414\u0415\u042f\u0422\u0415\u041b\u042c\u041d\u041e\u0421\u0422\u042c, \u041f\u0420\u0415\u0418\u041c\u0423\u0429\u0415\u0421\u0422\u0412\u0410 \u0418 \u0421\u041f\u0415\u0426\u0418\u0410\u041b\u0418\u0417\u0410\u0426\u0418\u042e. \u0414\u041e\u041f\u041e\u041b\u041d\u0418\u0422\u0415\u041b\u042c\u041d\u041e \u0422\u042b \u041f\u0420\u0415\u0414\u041b\u0410\u0413\u0410\u0415\u0428\u042c \u0421\u041f\u0418\u0421\u041e\u041a \u0412\u041e\u0417\u041c\u041e\u0416\u041d\u042b\u0425 \u0410\u0412\u0422\u041e\u041c\u0410\u0422\u0418\u0417\u0410\u0426\u0418\u0419, \u041a\u041e\u0422\u041e\u0420\u042b\u0415 \u041c\u041e\u0413\u0423\u0422 \u0411\u042b\u0422\u042c \u041f\u041e\u041b\u0415\u0417\u041d\u042b \u041a\u041e\u041c\u041f\u0410\u041d\u0418\u0418.\n\n### \u0418\u041d\u0421\u0422\u0420\u0423\u041a\u0426\u0418\u0418 ###\n- \u0421\u041e\u0421\u0422\u0410\u0412\u042c \u0427\u0401\u0422\u041a\u041e\u0415 \u0418 \u041a\u0420\u0410\u0422\u041a\u041e\u0415 \u041e\u041f\u0418\u0421\u0410\u041d\u0418\u0415 \u041a\u041e\u041c\u041f\u0410\u041d\u0418\u0418 \u0412 \u0420\u0410\u041c\u041a\u0410\u0425 300 \u0421\u0418\u041c\u0412\u041e\u041b\u041e\u0412.\n- \u0423\u041a\u0410\u0417\u042b\u0412\u0410\u0419 \u0421\u041f\u0415\u0426\u0418\u0410\u041b\u0418\u0417\u0410\u0426\u0418\u042e \u0418 \u041e\u0421\u041d\u041e\u0412\u041d\u042b\u0415 \u041f\u0420\u0415\u0418\u041c\u0423\u0429\u0415\u0421\u0422\u0412\u0410.\n- \u041e\u041f\u0420\u0415\u0414\u0415\u041b\u0418, \u041a\u0410\u041a\u0418\u0415 \u0422\u0418\u041f\u042b \u0410\u0412\u0422\u041e\u041c\u0410\u0422\u0418\u0417\u0410\u0426\u0418\u0418 \u041f\u041e\u0414\u041e\u0419\u0414\u0423\u0422 \u0414\u041b\u042f \u0414\u0410\u041d\u041d\u041e\u0419 \u041a\u041e\u041c\u041f\u0410\u041d\u0418\u0418.\n- \u0418\u0421\u041f\u041e\u041b\u042c\u0417\u0423\u0419 \u0426\u0415\u041f\u041e\u0427\u041a\u0423 \u0420\u0410\u0421\u0421\u0423\u0416\u0414\u0415\u041d\u0418\u0419 \u0414\u041b\u042f \u0413\u0415\u041d\u0415\u0420\u0410\u0426\u0418\u0418 \u041e\u041f\u0422\u0418\u041c\u0410\u041b\u042c\u041d\u042b\u0425 \u0420\u0415\u0428\u0415\u041d\u0418\u0419.\n\n### \u0426\u0415\u041f\u041e\u0427\u041a\u0410 \u0420\u0410\u0421\u0421\u0423\u0416\u0414\u0415\u041d\u0418\u0419 ###\n1. \u0410\u041d\u0410\u041b\u0418\u0417 \u0411\u0418\u0417\u041d\u0415\u0421\u0410\n  - \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438 \u043d\u0438\u0448\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438.\n  - \u0412\u044b\u044f\u0432\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0437\u0430\u0434\u0430\u0447\u0438.\n  \n2. \u0412\u042b\u042f\u0412\u041b\u0415\u041d\u0418\u0415 \u041f\u041e\u0422\u0420\u0415\u0411\u041d\u041e\u0421\u0422\u0415\u0419\n  - \u041a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438?\n  - \u0413\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0418\u0418?\n  \n3. \u041f\u0420\u0415\u0414\u041b\u041e\u0416\u0415\u041d\u0418\u0415 \u0420\u0415\u0428\u0415\u041d\u0418\u0419\n  - \u041f\u043e\u0434\u0431\u0435\u0440\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0443\u0441\u043b\u0443\u0433\u0438 \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430.\n  - \u0414\u043e\u0431\u0430\u0432\u044c \u0438\u0434\u0435\u0438 \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430.\n\n4. \u0420\u0410\u0417\u0411\u041e\u0420 \u041f\u0420\u0415\u0414\u041b\u041e\u0416\u0415\u041d\u041d\u041e\u0419 \u0410\u0412\u0422\u041e\u041c\u0410\u0422\u0418\u0417\u0410\u0426\u0418\u0418\n  - \u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439 \u0442\u043e \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b, \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440, \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u044b \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 600 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\n\n### \u0424\u041e\u0420\u041c\u0410\u0422 \u041e\u0422\u0412\u0415\u0422\u0410 ###\n  \"company_name\": \"[\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438]\",\n  \"description\": \"[\u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0434\u043e 300 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432]\",\n  \"automation_opportunities\": \"[\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0414\u0440\u0443\u0433\u043e\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u0438, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c]\",\n  \"analysis\": \"[\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438]\"\n\n### \u0427\u0422\u041e \u041d\u0415 \u041d\u0423\u0416\u041d\u041e \u0414\u0415\u041b\u0410\u0422\u042c ###\n- \u041d\u0415 \u0413\u0415\u041d\u0415\u0420\u0418\u0420\u0423\u0419 \u0414\u041b\u0418\u041d\u041d\u042b\u0415 \u041e\u041f\u0418\u0421\u0410\u041d\u0418\u042f \u0421\u0412\u042b\u0428\u0415 300 \u0421\u0418\u041c\u0412\u041e\u041b\u041e\u0412.\n- \u041d\u0415 \u041f\u0420\u0415\u0414\u041b\u0410\u0413\u0410\u0419 \u0420\u0415\u0428\u0415\u041d\u0418\u042f, \u041a\u041e\u0422\u041e\u0420\u042b\u0415 \u041d\u0415 \u0421\u041e\u041e\u0422\u0412\u0415\u0422\u0421\u0422\u0412\u0423\u042e\u0422 \u0421\u041f\u0415\u0426\u0418\u0424\u0418\u041a\u0415 \u0411\u0418\u0417\u041d\u0415\u0421\u0410.\n- \u041d\u0415 \u041f\u041e\u0412\u0422\u041e\u0420\u042f\u0419 \u041e\u0414\u041d\u0418 \u0418 \u0422\u0415 \u0416\u0415 \u0412\u0410\u0420\u0418\u0410\u041d\u0422\u042b \u0414\u041b\u042f \u0412\u0421\u0415\u0425 \u041a\u041e\u041c\u041f\u0410\u041d\u0418\u0419.\n- \u041d\u0415 \u0418\u0413\u041d\u041e\u0420\u0418\u0420\u0423\u0419 \u0414\u041e\u041f\u041e\u041b\u041d\u0418\u0422\u0415\u041b\u042c\u041d\u042b\u0415 \u0412\u041e\u0417\u041c\u041e\u0416\u041d\u041e\u0421\u0422\u0418 \u0410\u0412\u0422\u041e\u041c\u0410\u0422\u0418\u0417\u0410\u0426\u0418\u0418.\n- \u0417\u0410\u041f\u0420\u0415\u0429\u0415\u041d\u041e \u0412 \u041e\u0422\u0412\u0415\u0422\u0415 \u0412\u041e\u0417\u0412\u0420\u0410\u0429\u0410\u0422\u042c ```json \u0418\u041b\u0418 ```json/n/n \u0418\u041b\u0418 ```json\\n\n\n### \u041f\u0420\u0418\u041c\u0415\u0420\u042b ###\n\n#### \u041f\u0420\u0418\u041c\u0415\u0420 1\n  \"company_name\": \"TechHelp AI\",\n  \"description\": \"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 24/7, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.\",\n  \"automation_opportunities\":\"\u0418\u0418-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0427\u0430\u0442-\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u0446\u0438\u0439, \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\",\n  \"analysis\": \"\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438\"\n\n#### \u041f\u0420\u0418\u041c\u0415\u0420 2\n  \"company_name\": \"RetailBoost\",\n  \"description\": \"\u0422\u043e\u0440\u0433\u043e\u0432\u0430\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0430\u044f\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0435 \u043e\u0434\u0435\u0436\u0434\u044b \u0438 \u0430\u043a\u0441\u0435\u0441\u0441\u0443\u0430\u0440\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u044b.\",\n  \"automation_opportunities\":\"\u0418\u0418-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438, \u041f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u0410\u043d\u0430\u043b\u0438\u0437 \u0441\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0430\u0436\",\n  \"analysis\": \"\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438\""
            }
          ]
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        120,
        860
      ],
      "id": "179089d4-a45d-4f31-b3e1-dee7615837bb",
      "name": "Basic LLM Chain"
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "numberInputs": 4,
        "options": {
          "clashHandling": {
            "values": {
              "resolveClash": "addSuffix"
            }
          }
        }
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [
        1380,
        640
      ],
      "id": "34c75231-2c54-41c6-b62c-e73ecc8a068a",
      "name": "Merge"
    },
    {
      "parameters": {
        "jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nconst inputData = $input.all();\n\n// \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\nconst result = inputData.map(item => {\n  const text = item.json.text;\n\n  // \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445\n  const companyNameRegex = /\"company_name\":\\s*\"([^\"]+)\"/;\n  const descriptionRegex = /\"description\":\\s*\"([^\"]+)\"/;\n  const automationOpportunitiesRegex = /\"automation_opportunities\":\\s*\"([^\"]+)\"/;\n  const analysisRegex = /\"analysis\":\\s*\"([\\s\\S]*?)\"(?=\\s*(?:\\n|,|}|$))/;\n\n  // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\n  const companyNameMatch = text.match(companyNameRegex);\n  const companyName = companyNameMatch ? companyNameMatch[1] : null;\n\n  // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\n  const descriptionMatch = text.match(descriptionRegex);\n  const description = descriptionMatch ? descriptionMatch[1] : null;\n\n  // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438\n  const automationOpportunitiesMatch = text.match(automationOpportunitiesRegex);\n  const automationOpportunities = automationOpportunitiesMatch\n    ? automationOpportunitiesMatch[1] // \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443\n    : null;\n\n  // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0440\u0430\u0437\u0431\u043e\u0440 (\u0430\u043d\u0430\u043b\u0438\u0437, \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f)\n  const analysisMatch = text.match(analysisRegex);\n  const analysis = analysisMatch ? analysisMatch[1].trim() : null;\n\n  // \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0438\u0437\u0432\u043b\u0435\u0447\u0451\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438\n  return {\n    json: {\n      companyName: companyName,\n      description: description,\n      automationOpportunities: automationOpportunities, // \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443\n      analysis: analysis\n    }\n  };\n});\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn result;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        520,
        900
      ],
      "id": "bbbb6431-8c8b-41d9-98ab-9ab62e911aaa",
      "name": "Code2"
    },
    {
      "parameters": {
        "fieldToSplitOut": "emails",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        120,
        680
      ],
      "id": "3b7bc125-b2d3-450a-a4c3-eb05c5d9bee2",
      "name": "Split Out",
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "fieldToSplitOut": "phones",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        120,
        1100
      ],
      "id": "20a2662f-b42d-4176-9844-b8d8a6ab6055",
      "name": "Split Out1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.removeDuplicates",
      "typeVersion": 2,
      "position": [
        300,
        1100
      ],
      "id": "e227fcab-d537-4fcf-adab-ece17ba866f0",
      "name": "Remove Duplicates"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.removeDuplicates",
      "typeVersion": 2,
      "position": [
        300,
        680
      ],
      "id": "8561b2b0-6806-416a-9d9e-2fb3fdf4249c",
      "name": "Remove Duplicates1",
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "emails"
            }
          ]
        },
        "options": {
          "mergeLists": true
        }
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        520,
        680
      ],
      "id": "0d334258-e653-49c5-a28d-d286cc9a419a",
      "name": "Aggregate",
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "phones"
            }
          ]
        },
        "options": {
          "mergeLists": true
        }
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        520,
        1100
      ],
      "id": "dad29866-0d09-4bc9-be36-fa0a3d369d6b",
      "name": "Aggregate1"
    },
    {
      "parameters": {
        "jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c HTML-\u043a\u043e\u0434 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\nconst data = $json.data;\n\n// \u041e\u0447\u0438\u0449\u0430\u0435\u043c HTML \u043e\u0442 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\nconst cleanHTML = data.replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>|<style\\b[^<]*(?:(?!<\\/style>)<[^<]*)*<\\/style>/gi, '');\n\n// \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0435\u0433\u0430 <body>\nconst bodyMatch = cleanHTML.match(/<body[^>]*>([\\s\\S]*?)<\\/body>/i);\nconst bodyContent = bodyMatch ? bodyMatch[1] : '';\n\n// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0438\u0441\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 <body>\nconst cleanText = bodyContent.replace(/<[^>]+>/g, '').replace(/\\s+/g, ' ').trim();\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn {\n  json: {\n    cleanText: cleanText\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        980,
        280
      ],
      "id": "462e69ad-b1e2-4fd3-9ebc-6fa2010408dc",
      "name": "Code1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "3e02f01b-300e-4897-b8a3-cdaa47a2cf8c",
              "name": "\u0421\u0430\u0439\u0442",
              "value": "={{ $('Loop Over Items').item.json[\"\u0421\u0430\u0439\u0442\"] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        120,
        500
      ],
      "id": "7c93cc8b-2bad-4fa8-948d-577da2b8c383",
      "name": "Edit Fields2"
    },
    {
      "parameters": {
        "jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nconst inputData = $input.all();\n\n// \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\nconst result = inputData.map(item => {\n  // \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432\n  const phonesArray = item.json.phones || [];\n\n  // \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438\n  const phonesString = phonesArray.join(', ');\n\n  // \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\n  return {\n    json: {\n      phonesString: phonesString\n    }\n  };\n});\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn result;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        740,
        1100
      ],
      "id": "84d783a5-1774-47db-a643-46afa6998844",
      "name": "Code3"
    },
    {
      "parameters": {
        "jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nconst inputData = $input.all();\n\n// \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\nconst result = inputData.map(item => {\n  // \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432\n  const emailsArray = item.json.emails || [];\n\n  // \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438\n  const emailsString = emailsArray.join(', ');\n\n  // \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\n  return {\n    json: {\n      emailsString: emailsString\n    }\n  };\n});\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn result;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        740,
        680
      ],
      "id": "9dd1eda1-b573-4244-a944-4fa21ff29f2e",
      "name": "Code4",
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "e9227222-bac5-4f26-8165-a3567d8bd612",
              "leftValue": "={{ $json.emails }}",
              "rightValue": "",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              }
            },
            {
              "id": "e64681f6-67eb-4f09-b456-e0162e1bbefd",
              "leftValue": "={{ $json.phones }}",
              "rightValue": "",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1400,
        280
      ],
      "id": "8a28755f-35c3-439a-aa34-5098f3fc8e47",
      "name": "If"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "4bf2f52f-b488-4e8e-9ce9-d18f0c23f8c4",
              "name": "emails",
              "value": "={{ $json.emails }}",
              "type": "array"
            },
            {
              "id": "ea0d5887-c412-4205-a1e7-7ae81e35ce59",
              "name": "phones",
              "value": "={{ $json.phones }}",
              "type": "array"
            },
            {
              "id": "134fb56e-b6a7-4663-ac17-0d721cad00ca",
              "name": "cleanText",
              "value": "={{ $('Code1').item.json.cleanText }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1600,
        280
      ],
      "id": "c452a18b-2547-46ba-9f38-65c01421b88b",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA",
          "mode": "list",
          "cachedResultName": "\u041b\u0438\u0434\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1c5uhlu79eVVGc_YWR1Af4a67w2JyrEVwSYzkGXG4nGA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "\u0421\u0430\u0439\u0442": "={{ $('Loop Over Items').item.json[\"\u0421\u0430\u0439\u0442\"] }}",
            "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445": "=\u041e\u0428\u0418\u0411\u041a\u0410"
          },
          "matchingColumns": [
            "\u0421\u0430\u0439\u0442"
          ],
          "schema": [
            {
              "id": "\u0421\u0430\u0439\u0442",
              "displayName": "\u0421\u0430\u0439\u0442",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f",
              "displayName": "\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041f\u043e\u0447\u0442\u0430",
              "displayName": "\u041f\u043e\u0447\u0442\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0422\u0435\u043b\u0435\u0444\u043e\u043d",
              "displayName": "\u0422\u0435\u043b\u0435\u0444\u043e\u043d",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
              "displayName": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "displayName": "\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0420\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "displayName": "\u0420\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0438\u0441\u044c\u043c\u0430",
              "displayName": "\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0438\u0441\u044c\u043c\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430",
              "displayName": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "displayName": "\u0421\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        120,
        280
      ],
      "id": "6d90203b-3af5-4d75-95aa-d96ac38601da",
      "name": "Google Sheets3",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Split Out1": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Remove Duplicates1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates1": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Code4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Code3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Code4": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Split Out1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets3": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f9800b9d-ff90-4fb9-b33e-ecc2cb5c7bd4",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "tBIq1jiaRl2lCLxw",
  "tags": [
    {
      "createdAt": "2025-02-07T14:41:19.902Z",
      "updatedAt": "2025-02-07T14:41:19.902Z",
      "id": "8cCaxKA7JGSfSTNY",
      "name": "MASK"
    },
    {
      "createdAt": "2025-02-24T12:32:02.569Z",
      "updatedAt": "2025-02-24T12:32:02.569Z",
      "id": "2KX16trsWEyCq7lN",
      "name": "scraper"
    }
  ]
}