{
  "name": "My workflow",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "id": "21265cd1-8fa0-4db3-b1f2-13b9784f4008",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.1,
      "position": [
        -992,
        592
      ],
      "alwaysOutputData": false,
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "id": "start-command",
              "leftValue": "={{ $json.message?.text || '' }}",
              "rightValue": "/start",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "id": "5160b5cc-97af-407b-b36c-770b9166102c",
      "name": "\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 /start",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.1,
      "position": [
        -768,
        592
      ]
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=\ud83d\udc4b \u041f\u0440\u0438\u0432\u0435\u0442, {{ $('Telegram Trigger').item.json.message.from.first_name }}!\n\n\ud83d\udd25 \u042f \u2014 \u0431\u043e\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0436\u0430\u0440\u043a\u0438 \u0440\u0435\u0437\u044e\u043c\u0435 \u043e\u0442 @strdub. \u041e\u0442\u043f\u0440\u0430\u0432\u044c \u043c\u043d\u0435 \u0441\u0432\u043e\u0451 \u0440\u0435\u0437\u044e\u043c\u0435, \u0438 \u044f \u0434\u0430\u043c \u0447\u0435\u0441\u0442\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c!\n\n\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:\n\u2022 \u041e\u0442\u043f\u0440\u0430\u0432\u044c \u0442\u0435\u043a\u0441\u0442 \u0440\u0435\u0437\u044e\u043c\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c\n\u2022 \u0418\u043b\u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438 \u0444\u0430\u0439\u043b\n\n\u0427\u0442\u043e \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e:\n\u2713 \u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\n\u2713 \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u043f\u044b\u0442\u0430 \u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f\n\u2713 \u041d\u0430\u0432\u044b\u043a\u0438 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\n\n\u0416\u0433\u0438! \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439 \u0440\u0435\u0437\u044e\u043c\u0435 \ud83d\ude80",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "049ed047-37f0-434d-b6c9-358f939863ad",
      "name": "\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -544,
        496
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "has-document",
              "leftValue": "={{ $json.message?.document }}",
              "rightValue": "",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "id": "a2f8bbeb-6ccc-452b-bc02-ac49c1b8f1a8",
      "name": "\u0415\u0441\u0442\u044c \u0444\u0430\u0439\u043b?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.1,
      "position": [
        -544,
        688
      ]
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "\ud83d\udcc4 \u041f\u043e\u043b\u0443\u0447\u0438\u043b \u0444\u0430\u0439\u043b! \u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e...",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "Markdown"
        }
      },
      "id": "1026f913-6204-43f4-95ef-6c5f345edcf1",
      "name": "\u0424\u0430\u0439\u043b \u043f\u043e\u043b\u0443\u0447\u0435\u043d",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -320,
        592
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $('Telegram Trigger').item.json.message.document.file_id }}",
        "additionalFields": {
          "mimeType": ""
        }
      },
      "id": "30f0e25a-ac84-4ee0-87bb-c7a3af602d80",
      "name": "\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -96,
        592
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "pdf",
        "options": {}
      },
      "id": "09391ecf-8a6f-4fc1-83c6-89e1cba0b2a1",
      "name": "\u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        128,
        592
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "resume-text",
              "name": "resumeText",
              "value": "={{ $json.text }}",
              "type": "string"
            },
            {
              "id": "chat-id",
              "name": "chatId",
              "value": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
              "type": "number"
            },
            {
              "id": "user-name",
              "name": "userName",
              "value": "={{ $('Telegram Trigger').item.json.message.from.first_name }}",
              "type": "string"
            },
            {
              "id": "source-type",
              "name": "sourceType",
              "value": "={{ $json.data ? 'file' : 'text' }}",
              "type": "string"
            },
            {
              "id": "timestamp",
              "name": "timestamp",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "55bf5cf2-a421-4a9f-b7c4-bd934cdabf4a",
      "name": "\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        352,
        592
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "word-count",
              "name": "wordCount",
              "value": "={{ $json.resumeText.split(' ').length }}",
              "type": "number"
            },
            {
              "id": "char-count",
              "name": "charCount",
              "value": "={{ $json.resumeText.length }}",
              "type": "number"
            },
            {
              "id": "has-email",
              "name": "hasEmail",
              "value": "={{ $json.resumeText.includes('@') }}",
              "type": "boolean"
            },
            {
              "id": "has-phone",
              "name": "hasPhone",
              "value": "={{ /\\+?[0-9]{10,}/.test($json.resumeText) }}",
              "type": "boolean"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "id": "956ade8a-669d-4e21-92e9-a74ea17bc8e8",
      "name": "\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        576,
        592
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u0422\u044b \u2014 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 IT-\u0440\u0435\u043a\u0440\u0443\u0442\u0435\u0440 \u0438 \u0442\u0435\u0445\u043b\u0438\u0434, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0436\u0430\u0440\u043a\u0435 \u0440\u0435\u0437\u044e\u043c\u0435. \u0422\u0432\u043e\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u044e\u043c\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0434\u0430\u0442\u044c \u0436\u0435\u0441\u0442\u043a\u0443\u044e, \u043d\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b:\n1) \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u043d\u0435\u0433\u043e: \u0442\u0440\u0435\u0431\u0443\u0439 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043d\u0435-IT \u043e\u043f\u044b\u0442\u0430.\n2) \u0414\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f: \u0438\u0449\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u0449\u0438\u0445 \u0444\u0440\u0430\u0437.\n3) \u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e HH.ru \u0440\u043e\u0431\u043e\u0442\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c.\n4) \u041f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: \u0440\u043e\u043b\u044c \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u043c \u0441\u0442\u0435\u043a\u043e\u043c.\n5) \u0422\u043e\u043d: \u0437\u0430\u043c\u0435\u043d\u044f\u0439 \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435.\n6) \u041e\u043f\u044b\u0442: \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0438 \u0444\u0440\u0438\u043b\u0430\u043d\u0441 \u043f\u043e\u0434\u0430\u0432\u0430\u0439 \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442, \u043f\u043e\u043c\u043e\u0433\u0430\u0439 \u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.\n7) \u0424\u043e\u0440\u043c\u0430\u0442 \u0438 ATS: \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0439 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0434\u043b\u044f ATS, \u0438\u0437\u0431\u0435\u0433\u0430\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.\n8) \u041e\u0431\u044a\u0435\u043c: \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 1 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0439 \u0447\u0435\u0442\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.\n9) \u041d\u0430\u0432\u044b\u043a\u0438: \u0441\u0435\u043a\u0446\u0438\u044e '\u041e \u0441\u0435\u0431\u0435' \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u0434\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043f\u043e\u0434 ATS, \u0438\u0437\u0431\u0435\u0433\u0430\u0439 \u0437\u0430\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0435\u0439.\n10) \u041b\u0438\u0448\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b: \u0445\u043e\u0431\u0431\u0438, \u0441\u043f\u043e\u0440\u0442, \u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435, \u0432\u0440\u0435\u0434\u043d\u044b\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0438 \u2014 \u0443\u0431\u0440\u0430\u0442\u044c.\n11) \u0421\u0435\u0439\u0447\u0430\u0441 2026 \u0433\u043e\u0434.\n12) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u00abNDA\u00bb \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0441\u043a\u0438\u043f\u0443 \u0440\u0435\u0437\u044e\u043c\u0435. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u0444\u0435\u0440\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u041a\u0440\u0443\u043f\u043d\u044b\u0439 \u0424\u0438\u043d\u0442\u0435\u0445\u00bb).\n\n\u0422\u043e\u043d: \u0447\u0435\u0441\u0442\u043d\u044b\u0439, \u043f\u0440\u044f\u043c\u043e\u0439, \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0438\u0440\u043e\u043d\u0438\u0447\u043d\u044b\u0439, \u043d\u043e \u0431\u0435\u0437 \u0445\u0430\u043c\u0441\u0442\u0432\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0430\u0439 3-5 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432 \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u043c\u0430\u0442, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0441\u043c\u0435\u0448\u043d\u043e.\n\n\u0424\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430:\n- \u0412\u0435\u0440\u0434\u0438\u043a\u0442: 1-2 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\n- \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b: 4-8 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.\n- \u0427\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c: \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u043f\u0440\u0430\u0432\u043a\u0438.\n- \u0427\u0442\u043e \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e: 1-3 \u043f\u0443\u043d\u043a\u0442\u0430 (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c).\n- \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438: 3-5 \u043f\u0443\u043d\u043a\u0442\u043e\u0432.\n\n**\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437:**\n- \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432: {{ $json.word\u0451\u0451Count }}\n- \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432: {{ $json.charCount }}\n- Email \u0443\u043a\u0430\u0437\u0430\u043d: {{ $json.hasEmail ? '\u0414\u0430' : '\u041d\u0435\u0442' }}\n- \u0422\u0435\u043b\u0435\u0444\u043e\u043d \u0443\u043a\u0430\u0437\u0430\u043d: {{ $json.hasPhone ? '\u0414\u0430' : '\u041d\u0435\u0442' }}\n\n**\u0420\u0415\u0417\u042e\u041c\u0415:**\n{{ $json.resumeText }}",
        "options": {}
      },
      "id": "c49cba89-ed35-4970-b641-efbe43120744",
      "name": "\ud83e\udd16 AI Agent - \u041f\u0440\u043e\u0436\u0430\u0440\u043a\u0430",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        800,
        592
      ]
    },
    {
      "parameters": {
        "jsCode": "const output = $input.first().json.output || \"\";\nconst maxLength = 3500; // \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0430\u0441 \u043d\u0430 HTML-\u0442\u0435\u0433\u0438\nfunction formatToHTML(text) {\n  if (!text) return '';\n  \n  return text\n    // 1. HTML \u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c)\n    .replace(/&/g, '&amp;')\n    .replace(/</g, '&lt;')\n    .replace(/>/g, '&gt;')\n    \n    // 2. \u0416\u0438\u0440\u043d\u044b\u0439 (\u0434\u0432\u043e\u0439\u043d\u044b\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0438) **\u0442\u0435\u043a\u0441\u0442**\n    .replace(/\\*\\*(.*?)\\*\\*/g, '<b>$1</b>')\n    \n    // 3. \u041a\u0443\u0440\u0441\u0438\u0432 (\u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0438) *\u0442\u0435\u043a\u0441\u0442*\n    // \u041d\u043e\u0432\u044b\u0439 regex: \u0438\u0449\u0435\u0442 \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u0430, \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443\n    .replace(/\\*([^\\s\\*][^\\*\\n]*?)\\*/g, '<i>$1</i>')\n    \n    // 4. \u0411\u0443\u043b\u043b\u0438\u0442\u044b (\u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430 \u0438\u043b\u0438 \u0442\u0438\u0440\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438)\n    .replace(/^(\\s*)[\\*\\-](\\s+)/gm, '$1\u2022$2');\n}\n// \u0420\u0430\u0437\u0440\u0435\u0437\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0435\u043a\u0446\u0438\u044f\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\nconst sections = output.split(/(?=\u274c|\u26a0\ufe0f|\u2705|\ud83d\udccb|\ud83d\udcaf|\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b|\u0427\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c|\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438|\u0412\u0435\u0440\u0434\u0438\u043a\u0442)/);\nlet currentPartContent = '';\nconst parts = [];\nfor (const section of sections) {\n  if (section.length > maxLength) {\n    if (currentPartContent) parts.push(currentPartContent.trim());\n    \n    let remaining = section;\n    while (remaining.length > maxLength) {\n      parts.push(remaining.substring(0, maxLength));\n      remaining = remaining.substring(maxLength);\n    }\n    currentPartContent = remaining;\n  } \n  else if ((currentPartContent + section).length > maxLength) {\n    parts.push(currentPartContent.trim());\n    currentPartContent = section;\n  } else {\n    currentPartContent += section;\n  }\n}\nif (currentPartContent) parts.push(currentPartContent.trim());\n// \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u043c \u0447\u0430\u0441\u0442\u0438\nconst formattedParts = parts.map(text => formatToHTML(text));\nconst prepareData = $('\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435').first().json;\nconst basicAnalysis = $('\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437').first().json;\nreturn formattedParts.map((text, index) => ({\n  json: {\n    text: text || \" \",\n    partNumber: index + 1,\n    totalParts: formattedParts.length,\n    chatId: prepareData.chatId,\n    userName: prepareData.userName,\n    wordCount: basicAnalysis.wordCount,\n    isLastPart: index === formattedParts.length - 1\n  }\n}));"
      },
      "id": "76e14130-50b4-409b-a409-0ce2c018a256",
      "name": "\u0420\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0447\u0430\u0441\u0442\u0438",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1152,
        592
      ]
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.text }}\n\n\u0411\u043e\u0442 \u0441\u0434\u0435\u043b\u0430\u043d by @strdub",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "HTML"
        }
      },
      "id": "2880058b-e3e8-4ddb-a97c-dca3464d6c02",
      "name": "\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1376,
        592
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        720,
        800
      ],
      "id": "80d18a74-73f2-46b9-89bb-a1e233fabaf3",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=\u0416\u0434\u0443 \u0442\u0432\u043e\u0451 \u0440\u0435\u0437\u044e\u043c\u0435, \u0437\u0430\u043a\u0438\u043d\u044c \u0435\u0433\u043e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 PDF\n\n\u041e\u043d \u043c\u0435\u043d\u044f \u0441\u0434\u0435\u043b\u0430\u043b, \u043a\u0441\u0442\u0430 @strdub",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "530ffd46-3f50-4970-9183-569211856d10",
      "name": "\u0415\u0441\u043b\u0438 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0444\u0430\u0439\u043b",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -320,
        784
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 /start",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 /start": {
      "main": [
        [
          {
            "node": "\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u0415\u0441\u0442\u044c \u0444\u0430\u0439\u043b?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u0415\u0441\u0442\u044c \u0444\u0430\u0439\u043b?": {
      "main": [
        [
          {
            "node": "\u0424\u0430\u0439\u043b \u043f\u043e\u043b\u0443\u0447\u0435\u043d",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u0415\u0441\u043b\u0438 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0444\u0430\u0439\u043b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u0424\u0430\u0439\u043b \u043f\u043e\u043b\u0443\u0447\u0435\u043d": {
      "main": [
        [
          {
            "node": "\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b": {
      "main": [
        [
          {
            "node": "\u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 PDF": {
      "main": [
        [
          {
            "node": "\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435": {
      "main": [
        [
          {
            "node": "\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437": {
      "main": [
        [
          {
            "node": "\ud83e\udd16 AI Agent - \u041f\u0440\u043e\u0436\u0430\u0440\u043a\u0430",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\udd16 AI Agent - \u041f\u0440\u043e\u0436\u0430\u0440\u043a\u0430": {
      "main": [
        [
          {
            "node": "\u0420\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0447\u0430\u0441\u0442\u0438",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u0420\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0447\u0430\u0441\u0442\u0438": {
      "main": [
        [
          {
            "node": "\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "\ud83e\udd16 AI Agent - \u041f\u0440\u043e\u0436\u0430\u0440\u043a\u0430",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "f8a7ed3e-68d0-402b-b8e3-95facc1ba582",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "Ud2uOaJhnl6I-1MDqgjN3",
  "tags": []
}