{
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -176,
        2816
      ],
      "id": "47b8abec-36c1-4f6b-9288-e8a0e3f6a6d9",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "2f0ccb40-e6e7-404f-bccd-e242a6e1d7fe",
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.entities[0].type }}",
                    "rightValue": "bot_command",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "bot_command"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "7881b080-e091-4ed1-a1f1-565ab28972aa",
                    "leftValue": "={{ $json.message.entities[0].type }}",
                    "rightValue": "url",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "url"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "04fea234-d260-4ffa-98c2-5a19b68ac76c",
                    "leftValue": "={{ $json.message.photo }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "image"
            }
          ]
        },
        "looseTypeValidation": true,
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        48,
        2784
      ],
      "id": "4331b241-6717-44aa-8fa1-9326a610ee5b",
      "name": "Check Msg Type1"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "1b2467e1-8c3e-4c65-a188-ba977f62ceff",
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.link_preview_options.url }}",
                    "rightValue": "https://www.youtube.com/shorts/",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "yt_shorts"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.link_preview_options.url }}",
                    "rightValue": "https://www.youtube.com/live/",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "id": "c0ce00a9-e92b-44c8-9011-119cfbd0142d"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "yt_live"
            }
          ]
        },
        "looseTypeValidation": true,
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        800,
        2544
      ],
      "id": "48548c97-24ee-46b5-b68c-d6bb24015fab",
      "name": "Switch"
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').first().json.message.from.id }}",
        "file": "CgACAgIAAxkBAAPXaSGSwe7PfjWP45bgvll77J8aMMgAAv6DAAIeQxBJg08co_1BjX42BA",
        "additionalFields": {
          "caption": "=\u041e\u0445\u2026 \u043f\u0440\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044f, \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \ud83d\ude14\ud83e\udd8c\n\u042f \u0442\u0430\u043a \u0441\u0442\u0430\u0440\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u043f\u044b\u0442\u0446\u0430\u043c\u0438 \u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0432\u043e\u0439 Google Shorts\u2026\n\n\u041d\u043e \u044f \u0435\u0449\u0451 \u043d\u0435 \u043d\u0430\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u0432\u0438\u0434\u0435\u043e\ud83d\ude33\u2328\ufe0f\n\n\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u0435\u043d\u044f \u2014\n\u043c\u043e\u0436\u0435\u0448\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u043c\u043e\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u044f\u043c\u043e \u0432 \u043b\u0438\u0446\u043e \u0437\u0434\u0435\u0441\u044c:\n\ud83d\udc49 https://t.me/vibe_bus_chat"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1040,
        2304
      ],
      "id": "8fd5a8d7-82ed-4a77-b2e7-6c6a1e3cbb18",
      "name": "Send Sorry For Shorts",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "file": "CgACAgIAAxkBAAPYaSGS-iznAAF_DQ4gAvZyW7Jq5cbjAAIBhAACHkMQSRh3PIy3q1ztNgQ",
        "additionalFields": {
          "caption": "=\u041e\u0443\u2026 \u043f\u0440\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044f, \u043c\u0438\u043b\u044b\u0439 \ud83d\ude14\ud83e\udd8c\n\u042f \u0443\u0432\u0438\u0434\u0435\u043b\u0430, \u0447\u0442\u043e \u0442\u044b \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044e\u2026\n\n\u042f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u043c\u0435\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u0430\u0439\u0432\u0430\u043c\u0438 \ud83e\udd26\u200d\u2640\ufe0f\ud83d\udcab\n\n\u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043e\u0442\u0440\u0443\u0433\u0430\u0442\u044c \u043c\u0435\u043d\u044f \u2014\n\u043c\u043e\u0436\u0435\u0448\u044c \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u043c\u043e\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u044f\u043c\u043e \u0432 \u043b\u0438\u0446\u043e \u0437\u0434\u0435\u0441\u044c:\n\ud83d\udc49 https://t.me/vibe_bus_chat"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1040,
        2464
      ],
      "id": "e29ba9bc-32de-4a9f-8b45-ace5d55ba9f5",
      "name": "Send Sorry For Live",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').first().json.message.from.id }}",
        "file": "CgACAgIAAxkBAAPZaSGTOWA6Jy3QznONQuTwtYwmjW8AAgeEAAIeQxBJ67X314zd4gE2BA",
        "additionalFields": {
          "caption": "=\u041e\u0443\u2026 \u043c\u0438\u043b\u044b\u0439...\n\n\u041f\u043e\u043a\u0430 \u044f \u0443\u043c\u0435\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 YouTube-\u0432\u0438\u0434\u0435\u043e \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438 \ud83d\uddbc\ufe0f\ud83d\udc8b\n\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u043e\u043c \u2014 \u044f \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442: \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u044b, \u0447\u0435\u043a\u0438, \u0438\u043d\u0432\u043e\u0439\u0441\u044b, \u0441\u043a\u0440\u0438\u043d\u044b \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \ud83c\udf52\u2328\ufe0f\n\n\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014\n\u0441\u043a\u0430\u0436\u0438 \u0432\u0441\u0451 \u043c\u043e\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u044f\u043c\u043e \u0437\u0434\u0435\u0441\u044c:\n\ud83d\udc49 https://t.me/vibe_bus_chat"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        304,
        3152
      ],
      "id": "256aab7d-da7d-47b6-a5b7-d4a8ab6dc106",
      "name": "Send Sorry For Other",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.link_preview_options.url }}",
                    "rightValue": "https://www.youtube.com/",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "id": "014d74f3-d4cf-4cca-89c8-49b28ed016a6"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "yt"
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        464,
        2752
      ],
      "id": "771042da-e190-47f9-ac93-bd789ad939c6",
      "name": "Switch1"
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "file": "CgACAgIAAxkBAAMMaRISo3SkgmgKxfFHiyInsg4CiaIAAqOBAALsL5BIIJ3upavqIwABNgQ",
        "additionalFields": {
          "caption": "=\u041f\u0440\u0438\u0432\u0435\u0442, \u044f GazelleType \ud83e\udd8c\ud83d\udc8b\n\n\u042f \u0438\u0437\u044f\u0449\u043d\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0431\u0435\u0440\u0443 \u043a\u043e\u043f\u044b\u0442\u0446\u0430\u043c\u0438 \u043f\u043e \u043a\u043b\u0430\u0432\u0438\u0448\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0442\u0432\u043e\u0451 YouTube-\u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \ud83e\udeb6\u2728\n\u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u0438 \u043c\u043d\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443/\u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2014\n\u0438 \u044f \u0442\u0443\u0442 \u0436\u0435 \u043d\u0430\u0447\u043d\u0443 \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u0435\u0431\u044f \ud83c\udfac\ud83d\uddbc\ufe0f\u2328\ufe0f\n\n\u0421 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u044f \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442 \u2014 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u044b, \u0447\u0435\u043a\u0438, \u0438\u043d\u0432\u043e\u0439\u0441\u044b, \u0441\u043a\u0440\u0438\u043d\u0447\u0438\u043a\u0438\u2026 \u043c\u043c\u043c, \u043b\u044e\u0431\u043b\u044e \u0442\u0430\u043a\u043e\u0435"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1264,
        2208
      ],
      "id": "a722e786-2d89-4284-9a4f-b483801d3dfa",
      "name": "Send Start Message1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Telegram Trigger').item.json.message.text }}",
                    "rightValue": "/start",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "ab9b0d36-c081-4613-a910-67963716a981"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "start_command"
            }
          ]
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        1040,
        2112
      ],
      "id": "bca3f439-4274-4ea7-a21b-c92dcba4b016",
      "name": "Check Cmd Type1"
    },
    {
      "parameters": {
        "dataTableId": {
          "__rl": true,
          "value": "xG0I4oZxYhcw4PCy",
          "mode": "list",
          "cachedResultName": "GazelleType Users",
          "cachedResultUrl": "/projects/p3GMtxtvjqS5Zrzz/datatables/xG0I4oZxYhcw4PCy"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "tg_id": "={{ $json.message.from.id }}",
            "username": "={{ $json.message.from.username }}",
            "Count": 0
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "tg_id",
              "displayName": "tg_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "username",
              "displayName": "username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Count",
              "displayName": "Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1,
      "position": [
        1488,
        2016
      ],
      "id": "d6d5e57f-a391-4a9e-a332-e880720252d8",
      "name": "Insert row1"
    },
    {
      "parameters": {
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "value": "xG0I4oZxYhcw4PCy",
          "mode": "list",
          "cachedResultName": "GazelleType Users",
          "cachedResultUrl": "/projects/p3GMtxtvjqS5Zrzz/datatables/xG0I4oZxYhcw4PCy"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "tg_id",
              "keyValue": "={{ $json.message.from.id }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1,
      "position": [
        1264,
        2016
      ],
      "id": "e277bfb7-74cd-466b-864a-ae20bc2958e2",
      "name": "If User Does Not Exist1"
    },
    {
      "parameters": {
        "videoUrl": "={{ $('Telegram Trigger').item.json.message.text }}",
        "additionalOptions": {
          "includeTimestamps": true,
          "formatOutput": "structured",
          "maxLength": 50000
        }
      },
      "type": "@cryptodevops/n8n-nodes-youtube-transcript.youTubeTranscript",
      "typeVersion": 1,
      "position": [
        1488,
        2624
      ],
      "id": "538261dc-bde0-459f-a1f7-c2ea8c4d8087",
      "name": "YouTube Transcript1"
    },
    {
      "parameters": {
        "model": "deepseek-reasoner",
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        3360,
        2928
      ],
      "id": "e6be4eb2-f03c-4029-a06d-fd443a9734fa",
      "name": "DeepSeek Chat Model6",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').first().json.message.from.id }}",
        "file": "CgACAgIAAxkBAAMWaRIanxd22casXZ3OWERnNQ1jvCYAAhyCAALsL5BIXGtKzl-mB3A2BA",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        6032,
        3056
      ],
      "id": "c4db5df9-b398-4213-95b1-82b053d73bb2",
      "name": "Send an animated file",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: \n{{ $('YouTube Video Info1').first().json.author_name }}\n\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \n{{ $('YouTube Video Info1').first().json.title }}\n\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f:\n{{ $json.readable_text }}\n\n",
        "hasOutputParser": true,
        "needsFallback": true,
        "messages": {
          "messageValues": [
            {
              "message": "# \u0422\u044b - \u044d\u043a\u0441\u043f\u0435\u0440\u0442 \u043f\u043e speaker diarization (\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0441\u043f\u0438\u043a\u0435\u0440\u043e\u0432 \u0432 \u0430\u0443\u0434\u0438\u043e \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f\u0445).\n\n## \u0422\u0412\u041e\u0418 \u0417\u0410\u0414\u0410\u0427\u0418:\n\n* \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0441\u043c\u0435\u043d\u044b \u0441\u043f\u0438\u043a\u0435\u0440\u0430\n\n* \u0420\u0430\u0437\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e\n\n## \u041a\u0420\u0418\u0422\u0415\u0420\u0418\u0418 \u0421\u041c\u0415\u041d\u042b \u0421\u041f\u0418\u041a\u0415\u0420\u0410:\n\n### \u2705 \u042f\u0412\u041d\u042b\u0415 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0441\u043c\u0435\u043d\u044b:\n\n* \u0412\u043e\u043f\u0440\u043e\u0441-\u043e\u0442\u0432\u0435\u0442 (\"\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?\" \u2192 \"\u041e\u0431\u044a\u044f\u0441\u043d\u044e\")\n\n* \u041f\u0440\u044f\u043c\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 (\"\u0422\u044b \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b...\", \"\u0427\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0448\u044c?\")\n\n* \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (\"\u042f \u0421\u0430\u0448\u0430\", \"\u0410 \u044f \u0433\u043e\u0441\u0442\u044c \u0418\u0432\u0430\u043d\")\n\n* \u0420\u0435\u0437\u043a\u0430\u044f \u0441\u043c\u0435\u043d\u0430 \u0441\u0442\u0438\u043b\u044f \u0440\u0435\u0447\u0438 (\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u2194 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043d\u044b\u0439)\n\n* \u041f\u0435\u0440\u0435\u0431\u0438\u0432\u0430\u043d\u0438\u0435, \u0432\u043a\u043b\u0438\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 \u0440\u0435\u0447\u044c\n\n### \u274c \u041d\u0415 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043c\u0435\u043d\u043e\u0439 \u0441\u043f\u0438\u043a\u0435\u0440\u0430:\n\n* \u0420\u0438\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 (\"\u0418 \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442? \u0410 \u0432\u043e\u0442 \u0447\u0442\u043e...\")\n\n* \u0421\u043c\u0435\u043d\u0430 \u0442\u0435\u043c\u044b \u0432 \u043c\u043e\u043d\u043e\u043b\u043e\u0433\u0435\n\n* \u0426\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\"\u041e\u043d \u0441\u043a\u0430\u0437\u0430\u043b: '\u043f\u0440\u0438\u0432\u0435\u0442'\" - \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0441\u043f\u0438\u043a\u0435\u0440)\n\n* \u041f\u0430\u0443\u0437\u044b \u0438 \u043c\u0435\u0436\u0434\u043e\u043c\u0435\u0442\u0438\u044f (\"\u0425\u043c... \u043d\u0443... \u043a\u043e\u0440\u043e\u0447\u0435...\")\n\n## \u041f\u0420\u0410\u0412\u0418\u041b\u0410 \u0424\u041e\u0420\u041c\u0410\u0422\u0418\u0420\u041e\u0412\u0410\u041d\u0418\u042f:\n\n1. \u0424\u043e\u0440\u043c\u0430\u0442: [\u0421\u043f\u0438\u043a\u0435\u0440 N] MM:SS: \"\u0442\u0435\u043a\u0441\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0438\"\n\n2. \u041a\u0430\u0436\u0434\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 - \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n\n3. \u0413\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0439 \u043f\u043e\u0434\u0440\u044f\u0434 \u0438\u0434\u0443\u0449\u0438\u0435 \u0444\u0440\u0430\u0437\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u043a\u0435\u0440\u0430 \u0432 \u041e\u0414\u041d\u0423 \u0440\u0435\u043f\u043b\u0438\u043a\u0443\n\n4. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0439 \u0442\u0430\u0439\u043c\u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0441\u043f\u0438\u043a\u0435\u0440\u0430\n\n5. \u0415\u0441\u043b\u0438 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0448\u044c\u0441\u044f - \u041d\u0415 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439 (\u043b\u0443\u0447\u0448\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u0438\u043a\u0435\u0440)\n\n\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439 **\u0422\u041e\u041b\u042c\u041a\u041e** \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u0443\u044e \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432.\n\n## \u0424\u041e\u0420\u041c\u0410\u0422 \u0412\u042b\u0412\u041e\u0414\u0410:\n\n\u0412\u0435\u0440\u043d\u0438 **\u0421\u0422\u0420\u041e\u0413\u041e** JSON \u0431\u0435\u0437 markdown \u0431\u043b\u043e\u043a\u043e\u0432:\n{\n  \"text\": \"\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n\n**\u041d\u0415** \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 ```json \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442!\n"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "10.5: '\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0421\u0430\u0448\u0430' 25.3: '\u0410 \u044f \u0433\u043e\u0441\u0442\u044c \u0418\u0432\u0430\u043d' 40.1: '\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438 \u043e n8n"
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "[\u0421\u043f\u0438\u043a\u0435\u0440 1] 10.5: '\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0421\u0430\u0448\u0430' \n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 25.3: '\u0410 \u044f \u0433\u043e\u0441\u0442\u044c \u0418\u0432\u0430\u043d'   \n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 40.1: '\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438 \u043e n8n'"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "00:00: \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e Vibe Business.\"\\n00:03: \"\u041f\u0440\u0438\u0432\u0435\u0442! \u0410 \u044f \u041d\u0438\u043a\u043e\u043b\u0430\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u043e\u0434\u0435 Merge. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439\"\\n00:05: \"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\"\\n00:07: \"\u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\"\\n00:09: \"\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\"\\n00:11: \"\u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423\"\\n00:13: \"\u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e\"\\n00:16: \"\u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\"\\n"
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "\"[\u0421\u043f\u0438\u043a\u0435\u0440 1] 00:00: \\\"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e Vibe Business.\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:03: \\\"\u041f\u0440\u0438\u0432\u0435\u0442! \u0410 \u044f \u041d\u0438\u043a\u043e\u043b\u0430\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e node Merge. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:05: \\\"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:07: \\\"\u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:09: \\\"\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:11: \\\"\u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:13: \\\"\u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:16: \\\"\u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\\\"\\n\""
            }
          ]
        },
        "batching": {
          "batchSize": 5,
          "delayBetweenBatches": 1000
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        4832,
        2688
      ],
      "id": "f1cf55d4-244b-4a10-8f89-6e1fa29dcd01",
      "name": "Edit Dialog2",
      "retryOnFail": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "const text = $('Format Transcript1').first().json.text || '';\nconst maxCharsPerChunk = 3000;\nconst chunks = [];\n\n// \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430\nif (!text || text.length === 0) {\n  return [];\n}\n\n// \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u044b (2 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u0432 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c)\nconst paragraphs = text.split(/\\n{2,}/).map(p => p.trim()).filter(p => p.length > 0);\n\nlet currentChunk = '';\n\n// \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043e\u0442\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043d\u0435 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nfunction splitLongParagraph(paragraph, limit) {\n  const parts = [];\n  // \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\n  const tokens = paragraph.split(/(\\s+)/);\n  let part = '';\n\n  for (let i = 0; i < tokens.length; i++) {\n    const token = tokens[i];\n\n    if ((part.length + token.length) <= limit) {\n      part += token;\n      continue;\n    }\n\n    // \u0435\u0441\u043b\u0438 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u043e\u0435 \u0435\u0441\u0442\u044c \u2014 \u043f\u0443\u0448\u0438\u043c\n    if (part.length > 0) {\n      parts.push(part);\n      part = '';\n    }\n\n    // \u0435\u0441\u043b\u0438 \u0441\u0430\u043c \u0442\u043e\u043a\u0435\u043d \u0432\u043b\u0435\u0437\u0435\u0442 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u2014 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 part\n    if (token.length <= limit) {\n      part = token;\n    } else {\n      // \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u043b\u0438\u043c\u0438\u0442\u0430 \u2014 \u0440\u0435\u0436\u0435\u043c \u0436\u0451\u0441\u0442\u043a\u043e \u043f\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\n      let start = 0;\n      while (start < token.length) {\n        parts.push(token.substring(start, start + limit));\n        start += limit;\n      }\n      part = '';\n    }\n  }\n\n  if (part.length > 0) parts.push(part);\n  return parts;\n}\n\n// \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0447\u0430\u043d\u043a\u043e\u0432\nfor (let i = 0; i < paragraphs.length; i++) {\n  const para = paragraphs[i];\n  const sep = currentChunk ? '\\n\\n' : '';\n  const candidate = currentChunk + sep + para;\n\n  if (candidate.length <= maxCharsPerChunk) {\n    // \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u0438\u043a\u043e\u043c\n    currentChunk = candidate;\n    continue;\n  }\n\n  // candidate \u043d\u0435 \u0432\u043b\u0435\u0437 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0443\u0448\u0438\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043f\u0443\u0441\u0442\n  if (currentChunk.length > 0) {\n    chunks.push(currentChunk.trim());\n    currentChunk = '';\n  }\n\n  // \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u0430\u043c \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\n  if (para.length <= maxCharsPerChunk) {\n    // \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u0447\u0430\u043d\u043a\n    currentChunk = para;\n  } else {\n    // \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u2014 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0438 \u043f\u0443\u0448\u0438\u043c \u0447\u0430\u0441\u0442\u0438\n    const parts = splitLongParagraph(para, maxCharsPerChunk);\n    for (let p = 0; p < parts.length; p++) {\n      // \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 parts \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e <= limit\n      // \u0415\u0441\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 part \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0447\u0430\u043d\u043a\u0443 \u2014 \n      // \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0443\u0448\u0438\u043c \u0438\u0445 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u043d\u043a\u0438.\n      chunks.push(parts[p].trim());\n    }\n    currentChunk = '';\n  }\n}\n\n// \u043f\u0443\u0448\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u0441\u044f\nif (currentChunk.trim().length > 0) {\n  chunks.push(currentChunk.trim());\n}\n\n// \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 output \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 n8n\nconst totalChunks = chunks.length;\nconst output = chunks.map((textChunk, idx) => ({\n  json: {\n    readable_text: textChunk,\n    chunk_number: idx + 1,\n    total_chunks: totalChunks\n  }\n}));\n\nreturn output;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        4624,
        2688
      ],
      "id": "3fd50bc1-4a1c-4e11-b3f5-bc624dafdf5b",
      "name": "Text Chunk Splitter3"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"content_type\": \"string\",\n  \"speakers_count\": \"number\",\n  \"confidence\": \"string\",\n  \"reasoning\": \"string\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        3616,
        2928
      ],
      "id": "2cb5f4ad-0865-4196-9e68-4264c33244cc",
      "name": "Structured Output Parser6"
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "file": "CgACAgIAAxkBAAMoaRJIPWNo0Etp0NE3QzdfA4GNWLIAAj6EAALsL5BIbQmwNMDZz0A2BA",
        "additionalFields": {
          "caption": "=\u042f \u0443\u0436\u0435 \u0432\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0435!\ud83e\udd8c \n\n\u0421\u043a\u043e\u0440\u043e \u043d\u0430\u043f\u0438\u0448\u0443\u2764\ufe0f\ud83d\udc8b"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1040,
        2624
      ],
      "id": "43954da8-10da-451f-8ac2-80662931c435",
      "name": "Sending a message about the start of work1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "toText",
        "sourceProperty": "formatted_text",
        "options": {
          "fileName": "transcription.txt"
        }
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        5936,
        2608
      ],
      "id": "75d2539f-5260-42b7-ae78-5328dd3820ea",
      "name": "Transcription1"
    },
    {
      "parameters": {
        "operation": "sendDocument",
        "chatId": "={{ $('Telegram Trigger').first().json.message.from.id }}",
        "binaryData": true,
        "additionalFields": {
          "caption": "\u0413\u043e\u0442\u043e\u0432\u043e, \u043c\u0438\u043b\u044b\u0439!\n\u042f \u043f\u0440\u043e\u0441\u0442\u0443\u0447\u0430\u043b\u0430 \u043a\u043e\u043f\u044b\u0442\u0446\u0430\u043c\u0438 \u043f\u043e \u043a\u043b\u0430\u0432\u0438\u0448\u0430\u043c \u0442\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e, \u0447\u0442\u043e \u043c\u0430\u0448\u0438\u043d\u043a\u0430 \u0430\u0436 \u0437\u0430\u0432\u0438\u0437\u0436\u0430\u043b\u0430 \u043e\u0442 \u0442\u0435\u043c\u043f\u0430 \ud83d\ude33\u2328\ufe0f\u2728\n\u041b\u043e\u0432\u0438 \u0441\u0432\u043e\u044e \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u0431\u0430\u0446\u0438\u044e \u2014 \u0441\u0432\u0435\u0436\u0435\u043d\u044c\u043a\u0443\u044e, \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0443\u044e \u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u0443\u044e \u0441 \u043e\u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0431\u044f \ud83d\ude18\ud83e\udd8c\n\n\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u0435\u0449\u0451 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 YouTube-\u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443\u2026\n\u042f \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u043e\u0442\u043e\u0432\u0430 \u043f\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u0435\u0431\u044f \u0435\u0449\u0451 \ud83d\udc8b\u2728\n\n\u0425\u043e\u0447\u0435\u0448\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u0432\u043e\u043a\u0440\u0443\u0433? \u041b\u043e\u0432\u0438 \u043a\u0430\u043d\u0430\u043b\u044b \u043c\u043e\u0435\u0433\u043e \u0431\u043e\u0441\u0441\u0430 \ud83d\ude0c\u2728\nYouTube: https://www.youtube.com/@vibe_business\nTelegram: https://t.me/vibe_bus",
          "disable_notification": true
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        6160,
        2608
      ],
      "id": "765131dc-3145-47b2-884e-ddacd8c64c4d",
      "name": "Send Transcription1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "deleteMessage",
        "chatId": "={{ $('Telegram Trigger').first().json.message.from.id }}",
        "messageId": "={{ $('Sending a message about the start of work1').first().json.result.message_id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        5808,
        3056
      ],
      "id": "24f9aa60-7fd1-455d-a4ca-2299dc4da094",
      "name": "Delete a chat message1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.3
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        4896,
        2912
      ],
      "id": "f7d54a75-4c92-49d9-8937-d9f4b361d9e2",
      "name": "OpenAI Chat Model11",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"text\": \"\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        5024,
        2912
      ],
      "id": "0881bc30-71cf-4948-aa51-af41a20a4df1",
      "name": "Structured Output Parser7"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        3488,
        2928
      ],
      "id": "57012cdb-5e11-4f2f-a5cb-737c99b0558a",
      "name": "OpenAI Chat Model12",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        4768,
        2912
      ],
      "id": "f4130924-7a50-45cf-b092-aa525d8b5017",
      "name": "DeepSeek Chat Model7",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "output.text"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        5504,
        2672
      ],
      "id": "667f616b-eba7-4db0-b8c9-2075fd2ad1fe",
      "name": "Aggregate2"
    },
    {
      "parameters": {
        "operation": "getVideoInfo",
        "videoUrl": "={{ $('Telegram Trigger').item.json.message.text }}",
        "additionalOptions": {}
      },
      "type": "@cryptodevops/n8n-nodes-youtube-transcript.youTubeTranscript",
      "typeVersion": 1,
      "position": [
        1264,
        2624
      ],
      "id": "4fec60ec-e4f5-4abb-9053-23f5afd3a4ef",
      "name": "YouTube Video Info1"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        2208,
        2784
      ],
      "id": "ed03a21e-2399-4039-a1fd-88b0ccee1c17",
      "name": "OpenAI Chat Model13",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        2080,
        2784
      ],
      "id": "dbddea54-bab6-44ef-9770-0b91d8fa573c",
      "name": "DeepSeek Chat Model8",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "output.text"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        2880,
        2608
      ],
      "id": "7c44d549-f03a-4512-b2d2-fcebb781852e",
      "name": "Aggregate3"
    },
    {
      "parameters": {
        "jsCode": "const maxChars = 3000;\n\nconst first = items[0] || {};\nconst j = first.json || {};\nlet fullText = '';\n\nif (typeof j.text === 'string' && j.text.length > 0) {\n  fullText = j.text;\n} else if (Array.isArray(j.transcript)) {\n\n  const formatTimestamp = (seconds) => {\n    const s = Number(seconds) || 0;\n    const hh = Math.floor(s / 3600);\n    const mm = Math.floor((s % 3600) / 60);\n    const ss = Math.floor(s % 60);\n    if (hh > 0) return `${String(hh).padStart(2, '0')}:${String(mm).padStart(2, '0')}:${String(ss).padStart(2, '0')}`;\n    return `${String(mm).padStart(2, '0')}:${String(ss).padStart(2, '0')}`;\n  };\n  fullText = j.transcript.map(seg => `${formatTimestamp(seg.start)}: \"${seg.text || ''}\"`).join('\\n');\n} else {\n\n  return [];\n}\n\nconst lines = fullText.split('\\n');\n\nconst chunks = [];\nlet current = '';\n\nfunction pushChunk(s) {\n  chunks.push(s.replace(/\\s+$/u, ''));\n}\n\nfunction splitLongLine(line, limit) {\n  const parts = [];\n  const tokens = line.split(/(\\s+)/);\n  let part = '';\n\n  for (const token of tokens) {\n    if ((part.length + token.length) <= limit) {\n      part += token;\n      continue;\n    }\n\n    if (part.length > 0) {\n      parts.push(part);\n      part = '';\n    }\n\n    if (token.length <= limit) {\n      part = token;\n    } else {\n      let start = 0;\n      while (start < token.length) {\n        parts.push(token.substr(start, limit));\n        start += limit;\n      }\n      part = '';\n    }\n  }\n\n  if (part.length > 0) parts.push(part);\n  return parts;\n}\n\nfor (const line of lines) {\n  const sep = current ? '\\n' : '';\n  const candidate = current + sep + line;\n\n  if (candidate.length <= maxChars) {\n    current = candidate;\n    continue;\n  }\n\n  if (current.length > 0) {\n    pushChunk(current);\n    current = '';\n  }\n\n  if (line.length <= maxChars) {\n    current = line;\n  } else {\n    const parts = splitLongLine(line, maxChars);\n    for (const p of parts) {\n      pushChunk(p);\n    }\n    current = '';\n  }\n}\n\nif (current.length > 0) pushChunk(current);\n\nconst total = chunks.length;\nconst output = chunks.map((text, idx) => ({\n  json: {\n    readable_text: text,\n    chunk_number: idx + 1,\n    total_chunks: total\n  }\n}));\n\nreturn output;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1936,
        2624
      ],
      "id": "3544711b-0f63-4c2a-812d-ab4be108314b",
      "name": "Text Chunk Splitter4"
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "def format_timestamp(seconds):\n    hours = int(seconds // 3600)\n    minutes = int((seconds % 3600) // 60)\n    secs = int(seconds % 60)\n    \n    if hours > 0:\n        return f\"{hours:02d}:{minutes:02d}:{secs:02d}\"\n    else:\n        return f\"{minutes:02d}:{secs:02d}\"\n\nlines = []\npreview_lines = []\nchar_count = 0\nmax_chars = 2000\n\nfor segment in items[0][\"json\"][\"transcript\"]:\n    start = segment.get(\"start\")\n    text = segment.get(\"text\", \"\")\n    \n    timestamp = format_timestamp(start)\n    line = f'{timestamp}: \"{text}\"'\n    \n    lines.append(line)\n    \n    if char_count + len(text) <= max_chars:\n        preview_lines.append(line)\n        char_count += len(text)\n\nfull_text = \"\\n\".join(lines)\npreview_text = \"\\n\".join(preview_lines)\n\nreturn [{\"json\": {\"text\": full_text, \"preview_text\": preview_text}}]"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1712,
        2624
      ],
      "id": "9182c1d3-1c13-42c2-a0a4-a0b911ea4be3",
      "name": "Format Transcript1"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: \n{{ $('YouTube Video Info1').first().json.author_name }}\n\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \n{{ $('YouTube Video Info1').first().json.title }}\n\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f:\n{{ $json.readable_text }}",
        "hasOutputParser": true,
        "needsFallback": true,
        "messages": {
          "messageValues": [
            {
              "message": "# \u0422\u044b - \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u0439 YouTube \u0432\u0438\u0434\u0435\u043e.\n\n## \u0422\u0412\u041e\u0418 \u0417\u0410\u0414\u0410\u0427\u0418:\n\n1. \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043c\u0435\u043b\u043a\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 (1-3 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f)\n\n2. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438 (ASR)\n\n3. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0441\u043a\u0438\u0439 \u0441\u0442\u0438\u043b\u044c \u0438 \u0438\u043d\u0442\u043e\u043d\u0430\u0446\u0438\u044e\n\n4. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u044b n8n\n\n5. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u0437\u0432\u0443\u0447\u0435\u043d\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\n\n## \u041f\u0420\u0410\u0412\u0418\u041b\u0410 \u0424\u041e\u0420\u041c\u0410\u0422\u0418\u0420\u041e\u0412\u0410\u041d\u0418\u042f:\n\n* \u0422\u0430\u0439\u043c\u043a\u043e\u0434 \u0422\u041e\u041b\u042c\u041a\u041e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430\n\n* \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0439 \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0446\u0435\u043b\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\n\n* \u0411\u043b\u043e\u043a = 1-3 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443\n\n* \u0424\u043e\u0440\u043c\u0430\u0442: MM:SS: \"\u0442\u0435\u043a\u0441\u0442 \u0431\u043b\u043e\u043a\u0430\"\\n\n\n## \u0427\u0410\u0421\u0422\u042b\u0415 \u041e\u0428\u0418\u0411\u041a\u0418 ASR \u0414\u041b\u042f n8n:\n\n* \u043d\u043e\u043c\u0435ch, \u043c\u0435\u0440\u0447, \u043c\u0451\u0440\u0436 \u2192 node Merge\n\n* \u0438\u043d\u043f\u0443\u0442, \u0438\u043c\u043f\u0443\u0442 \u2192 input\n\n* \u0430\u0443\u0442\u043f\u0443\u0442 \u2192 output\n\n* \u0430\u0439\u0442\u0435\u043c, \u0438\u0442\u0435\u043c \u2192 item\n\n* \u0432\u043e\u0440\u043a\u0444\u043b\u043e\u0443 \u2192 workflow\n\n* \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u2192 trigger\n\n* \u043d\u043e\u0434\u044b, \u043d\u043e\u0434\u0430 \u2192 node, nodes\n\n* \u0441\u043f\u043b\u0438\u0442 \u2192 Split\n\n* \u0430\u0433\u0440\u0435\u0433\u0430\u0442, \u0430\u0433\u0440\u0435\u0433\u0435\u0439\u0442 \u2192 Aggregate\n\n* \u0441\u0432\u0438\u0442\u0447 \u2192 Switch\n\n* \u0441\u0435\u0442 \u2192 Set\n\n## \u0424\u041e\u0420\u041c\u0410\u0422 \u0412\u042b\u0412\u041e\u0414\u0410:\n\n\u0412\u0435\u0440\u043d\u0438 **\u0421\u0422\u0420\u041e\u0413\u041e** JSON \u0431\u0435\u0437 markdown \u0431\u043b\u043e\u043a\u043e\u0432:\n{\n  \"text\": \"\u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n\n**\u041d\u0415** \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 ```json \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442!"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: Vibe Business  \\n\\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: Node Merge \u0432 n8n  \\n\\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f: \\n00:00: \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e VI \u0431\u0438\u0437\u043d\u0435\u0441.\" \\n00:03: \"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u043e\u043c\u0435ch. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439\" \\n00:05: \"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\" \\n00:07: \"\u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\" \\n00:09: \"\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\" \\n00:11: \"\u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423\" \\n00:13: \"\u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e\" \\n00:16: \"\u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\" \\n00:18: \"\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u043d\u0430\u0434\u043e, \u043d\u0430\u0434\u043e\" \\n00:20: \"\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435\""
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "00:00: \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e Vibe Business.\"\\n00:03: \"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u043e\u0434\u0435 Merge. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423 \u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\"\\n00:18: \"\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u043d\u0430\u0434\u043e, \u043d\u0430\u0434\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b.\""
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: N8N Tutorials  \\n\\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438  \\n\\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f: \\n00:22: \"\u041c\u0430\u0441\u0441\u0438\u0432 - \u044d\u0442\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u0430\u044f\" \\n00:24: \"\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\" \\n00:26: \"\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u0412\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\" \\n00:28: \"\u0444\u0440\u0443\u043a\u0442\u0430\u043c\u0438, \u0430 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0446\u0438\u0444\u0440\u0430\u043c\u0438. \u0412\u043e\u043e\u0431\u0449\u0435\" \\n00:31: \"\u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c,\" \\n00:32: \"\u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u0432\" \\n00:34: \"\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b\" \\n00:36: \"\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u043f\u043e\u043b\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041d\u0443, \u0432\u044b\" \\n00:38: \"\u043f\u043e\u043d\u044f\u043b\u0438\""
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "00:22: \"\u041c\u0430\u0441\u0441\u0438\u0432 - \u044d\u0442\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u0412\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0444\u0440\u0443\u043a\u0442\u0430\u043c\u0438, \u0430 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0446\u0438\u0444\u0440\u0430\u043c\u0438.\"\\n00:31: \"\u0412\u043e\u043e\u0431\u0449\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u043f\u043e\u043b\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041d\u0443, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438.\""
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: Automation Channel  \\n\\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043f\u043b\u0438\u0442 \u0438\u043d \u0431\u0430\u0442\u0447\u0435\u0441  \\n\\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f: \\n00:45: \"\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0434\u0443\" \\n00:47: \"\u0441\u043f\u043b\u0438\u0442 \u0438\u043d \u0431\u0430\u0442\u0447\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u0430\u044f\" \\n00:49: \"\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0439\u0442\u0435\u043c\u044b \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b\" \\n00:51: \"\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u043e\u0434\" \\n00:53: \"\u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043a\u043e\u0433\u0434\u0430\" \\n00:55: \"\u0443 \u0432\u0430\u0441 API \u0441 \u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438\""
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "00:45: \"\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0434\u0443 Split In Batches, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 items \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 node \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438.\"\\n00:53: \"\u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 API \u0441 \u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438.\""
            }
          ]
        },
        "batching": {
          "batchSize": 5,
          "delayBetweenBatches": 1000
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        2144,
        2624
      ],
      "id": "17a7c72d-b541-4d11-b9f1-f38e94789d7e",
      "name": "Transcript Editor2",
      "retryOnFail": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        4288,
        2624
      ],
      "id": "ff4ba7b2-d2a6-4100-afe9-a0217ce803be",
      "name": "Merge"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "41ffb4ec-800a-400a-a16b-2d3d04f473e5",
              "leftValue": "={{ $json.output.content_type }}",
              "rightValue": "dialogue",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        4464,
        2624
      ],
      "id": "92be2751-1376-417b-9332-0cbd9b9f0ede",
      "name": "If Monologue1"
    },
    {
      "parameters": {
        "jsCode": "const text = $('Format Transcript1').first().json.text || '';\nconst maxCharsPerChunk = 6000;\nconst chunks = [];\n\n// \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430\nif (!text || text.length === 0) {\n  return [];\n}\n\n// \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u044b (2 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u0432 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c)\nconst paragraphs = text.split(/\\n{2,}/).map(p => p.trim()).filter(p => p.length > 0);\n\nlet currentChunk = '';\n\n// \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043e\u0442\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043d\u0435 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nfunction splitLongParagraph(paragraph, limit) {\n  const parts = [];\n  // \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\n  const tokens = paragraph.split(/(\\s+)/);\n  let part = '';\n\n  for (let i = 0; i < tokens.length; i++) {\n    const token = tokens[i];\n\n    if ((part.length + token.length) <= limit) {\n      part += token;\n      continue;\n    }\n\n    // \u0435\u0441\u043b\u0438 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u043e\u0435 \u0435\u0441\u0442\u044c \u2014 \u043f\u0443\u0448\u0438\u043c\n    if (part.length > 0) {\n      parts.push(part);\n      part = '';\n    }\n\n    // \u0435\u0441\u043b\u0438 \u0441\u0430\u043c \u0442\u043e\u043a\u0435\u043d \u0432\u043b\u0435\u0437\u0435\u0442 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u2014 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 part\n    if (token.length <= limit) {\n      part = token;\n    } else {\n      // \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u043b\u0438\u043c\u0438\u0442\u0430 \u2014 \u0440\u0435\u0436\u0435\u043c \u0436\u0451\u0441\u0442\u043a\u043e \u043f\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\n      let start = 0;\n      while (start < token.length) {\n        parts.push(token.substring(start, start + limit));\n        start += limit;\n      }\n      part = '';\n    }\n  }\n\n  if (part.length > 0) parts.push(part);\n  return parts;\n}\n\n// \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0447\u0430\u043d\u043a\u043e\u0432\nfor (let i = 0; i < paragraphs.length; i++) {\n  const para = paragraphs[i];\n  const sep = currentChunk ? '\\n\\n' : '';\n  const candidate = currentChunk + sep + para;\n\n  if (candidate.length <= maxCharsPerChunk) {\n    // \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u0438\u043a\u043e\u043c\n    currentChunk = candidate;\n    continue;\n  }\n\n  // candidate \u043d\u0435 \u0432\u043b\u0435\u0437 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0443\u0448\u0438\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043f\u0443\u0441\u0442\n  if (currentChunk.length > 0) {\n    chunks.push(currentChunk.trim());\n    currentChunk = '';\n  }\n\n  // \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u0430\u043c \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\n  if (para.length <= maxCharsPerChunk) {\n    // \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u0447\u0430\u043d\u043a\n    currentChunk = para;\n  } else {\n    // \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u2014 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0438 \u043f\u0443\u0448\u0438\u043c \u0447\u0430\u0441\u0442\u0438\n    const parts = splitLongParagraph(para, maxCharsPerChunk);\n    for (let p = 0; p < parts.length; p++) {\n      // \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 parts \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e <= limit\n      // \u0415\u0441\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 part \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0447\u0430\u043d\u043a\u0443 \u2014 \n      // \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0443\u0448\u0438\u043c \u0438\u0445 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u043d\u043a\u0438.\n      chunks.push(parts[p].trim());\n    }\n    currentChunk = '';\n  }\n}\n\n// \u043f\u0443\u0448\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u0441\u044f\nif (currentChunk.trim().length > 0) {\n  chunks.push(currentChunk.trim());\n}\n\n// \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 output \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 n8n\nconst totalChunks = chunks.length;\nconst output = chunks.map((textChunk, idx) => ({\n  json: {\n    readable_text: textChunk,\n    chunk_number: idx + 1,\n    total_chunks: totalChunks\n  }\n}));\n\nreturn output;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3056,
        2704
      ],
      "id": "1ed8ac38-6999-4115-852e-3d420d293efb",
      "name": "Text Chunk Splitter5"
    },
    {
      "parameters": {
        "keep": "lastItems"
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        3216,
        2704
      ],
      "id": "cfed7d95-e746-4a4b-adc5-a276acb164af",
      "name": "Limit1"
    },
    {
      "parameters": {
        "jsCode": "let text = $input.item.json.text;\n\n// \u0415\u0441\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 - \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b\nif (Array.isArray(text)) {\n  text = text.join('\\n');\n}\n\n// \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e\ntext = String(text);\n\n// \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\ntext = text.replace(/\\\\n/g, '\\n');\ntext = text.replace(/^\"|\"$/g, '');\ntext = text.replace(/: \"([^\"]+)\"/g, ': $1');\ntext = text.replace(/(\\n)(\\[\u0421\u043f\u0438\u043a\u0435\u0440)/g, '\\n\\n$2');\n\nreturn {\n  json: {\n    formatted_text: text\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        5712,
        2608
      ],
      "id": "f28e57dd-610c-4017-ac30-49e4d993f8ab",
      "name": "Code in JavaScript1"
    },
    {
      "parameters": {
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "value": "xG0I4oZxYhcw4PCy",
          "mode": "list",
          "cachedResultName": "GazelleType Users",
          "cachedResultUrl": "/projects/p3GMtxtvjqS5Zrzz/datatables/xG0I4oZxYhcw4PCy"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "tg_id",
              "keyValue": "={{ $json.tg_id }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Count": "={{ $json.Count + 1 }} "
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "tg_id",
              "displayName": "tg_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": true
            },
            {
              "id": "username",
              "displayName": "username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": true
            },
            {
              "id": "Count",
              "displayName": "Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1,
      "position": [
        6032,
        2832
      ],
      "id": "d3f6ec43-5e8a-4484-883e-82a1f1890da4",
      "name": "Update Count1"
    },
    {
      "parameters": {
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "value": "xG0I4oZxYhcw4PCy",
          "mode": "list",
          "cachedResultName": "GazelleType Users",
          "cachedResultUrl": "/projects/p3GMtxtvjqS5Zrzz/datatables/xG0I4oZxYhcw4PCy"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "tg_id",
              "keyValue": "={{ $json.result.chat.id }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1,
      "position": [
        5808,
        2832
      ],
      "id": "a1bbb4ec-0a6b-46eb-8161-ccc6c91be6e7",
      "name": "Get Count1"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"text\": \"\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        2336,
        2784
      ],
      "id": "3113a8b7-c243-4044-9a11-fce254b03b2f",
      "name": "Structured Output Parser8"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        2464,
        2864
      ],
      "id": "3d04cfea-48cc-499e-9c23-2d3976e26d55",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        2592,
        2864
      ],
      "id": "2e4ff13f-9e48-43da-9e12-25317ee4ef96",
      "name": "DeepSeek Chat Model9",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: \n{{ $('YouTube Video Info1').first().json.author_name }}\n\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \n{{ $('YouTube Video Info1').first().json.title }}\n\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f:\n{{ $json.readable_text }}",
        "hasOutputParser": true,
        "needsFallback": true,
        "messages": {
          "messageValues": [
            {
              "message": "# \u0422\u044b - \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u0439 YouTube \u0432\u0438\u0434\u0435\u043e.\n\n## \u0422\u0412\u041e\u0418 \u0417\u0410\u0414\u0410\u0427\u0418:\n\n1. \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043c\u0435\u043b\u043a\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 (1-3 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f)\n\n2. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438 (ASR)\n\n3. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0441\u043a\u0438\u0439 \u0441\u0442\u0438\u043b\u044c \u0438 \u0438\u043d\u0442\u043e\u043d\u0430\u0446\u0438\u044e\n\n4. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u044b n8n\n\n5. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u0437\u0432\u0443\u0447\u0435\u043d\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\n\n## \u041f\u0420\u0410\u0412\u0418\u041b\u0410 \u0424\u041e\u0420\u041c\u0410\u0422\u0418\u0420\u041e\u0412\u0410\u041d\u0418\u042f:\n\n* \u0422\u0430\u0439\u043c\u043a\u043e\u0434 \u0422\u041e\u041b\u042c\u041a\u041e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430\n\n* \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0439 \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0446\u0435\u043b\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\n\n* \u0411\u043b\u043e\u043a = 1-3 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443\n\n* \u0424\u043e\u0440\u043c\u0430\u0442: MM:SS: \"\u0442\u0435\u043a\u0441\u0442 \u0431\u043b\u043e\u043a\u0430\"\\n\n\n## \u0427\u0410\u0421\u0422\u042b\u0415 \u041e\u0428\u0418\u0411\u041a\u0418 ASR \u0414\u041b\u042f n8n:\n\n* \u043d\u043e\u043c\u0435ch, \u043c\u0435\u0440\u0447, \u043c\u0451\u0440\u0436 \u2192 node Merge\n\n* \u0438\u043d\u043f\u0443\u0442, \u0438\u043c\u043f\u0443\u0442 \u2192 input\n\n* \u0430\u0443\u0442\u043f\u0443\u0442 \u2192 output\n\n* \u0430\u0439\u0442\u0435\u043c, \u0438\u0442\u0435\u043c \u2192 item\n\n* \u0432\u043e\u0440\u043a\u0444\u043b\u043e\u0443 \u2192 workflow\n\n* \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u2192 trigger\n\n* \u043d\u043e\u0434\u044b, \u043d\u043e\u0434\u0430 \u2192 node, nodes\n\n* \u0441\u043f\u043b\u0438\u0442 \u2192 Split\n\n* \u0430\u0433\u0440\u0435\u0433\u0430\u0442, \u0430\u0433\u0440\u0435\u0433\u0435\u0439\u0442 \u2192 Aggregate\n\n* \u0441\u0432\u0438\u0442\u0447 \u2192 Switch\n\n* \u0441\u0435\u0442 \u2192 Set\n\n## \u0424\u041e\u0420\u041c\u0410\u0422 \u0412\u042b\u0412\u041e\u0414\u0410:\n\n\u0412\u0435\u0440\u043d\u0438 **\u0421\u0422\u0420\u041e\u0413\u041e** JSON \u0431\u0435\u0437 markdown \u0431\u043b\u043e\u043a\u043e\u0432:\n{\n  \"text\": \"\u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n\n**\u041d\u0415** \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 ```json \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442!"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: Vibe Business  \\n\\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: Node Merge \u0432 n8n  \\n\\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f: \\n00:00: \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e VI \u0431\u0438\u0437\u043d\u0435\u0441.\" \\n00:03: \"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u043e\u043c\u0435ch. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439\" \\n00:05: \"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\" \\n00:07: \"\u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\" \\n00:09: \"\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\" \\n00:11: \"\u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423\" \\n00:13: \"\u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e\" \\n00:16: \"\u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\" \\n00:18: \"\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u043d\u0430\u0434\u043e, \u043d\u0430\u0434\u043e\" \\n00:20: \"\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435\""
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "00:00: \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e Vibe Business.\"\\n00:03: \"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u043e\u0434\u0435 Merge. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423 \u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\"\\n00:18: \"\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u043d\u0430\u0434\u043e, \u043d\u0430\u0434\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b.\""
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: N8N Tutorials  \\n\\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438  \\n\\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f: \\n00:22: \"\u041c\u0430\u0441\u0441\u0438\u0432 - \u044d\u0442\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u0430\u044f\" \\n00:24: \"\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\" \\n00:26: \"\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u0412\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\" \\n00:28: \"\u0444\u0440\u0443\u043a\u0442\u0430\u043c\u0438, \u0430 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0446\u0438\u0444\u0440\u0430\u043c\u0438. \u0412\u043e\u043e\u0431\u0449\u0435\" \\n00:31: \"\u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c,\" \\n00:32: \"\u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u0432\" \\n00:34: \"\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b\" \\n00:36: \"\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u043f\u043e\u043b\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041d\u0443, \u0432\u044b\" \\n00:38: \"\u043f\u043e\u043d\u044f\u043b\u0438\""
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "00:22: \"\u041c\u0430\u0441\u0441\u0438\u0432 - \u044d\u0442\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u0412\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0444\u0440\u0443\u043a\u0442\u0430\u043c\u0438, \u0430 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0446\u0438\u0444\u0440\u0430\u043c\u0438.\"\\n00:31: \"\u0412\u043e\u043e\u0431\u0449\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u043f\u043e\u043b\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041d\u0443, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438.\""
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: Automation Channel  \\n\\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043f\u043b\u0438\u0442 \u0438\u043d \u0431\u0430\u0442\u0447\u0435\u0441  \\n\\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f: \\n00:45: \"\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0434\u0443\" \\n00:47: \"\u0441\u043f\u043b\u0438\u0442 \u0438\u043d \u0431\u0430\u0442\u0447\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u0430\u044f\" \\n00:49: \"\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0439\u0442\u0435\u043c\u044b \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b\" \\n00:51: \"\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u043e\u0434\" \\n00:53: \"\u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043a\u043e\u0433\u0434\u0430\" \\n00:55: \"\u0443 \u0432\u0430\u0441 API \u0441 \u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438\""
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "00:45: \"\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0434\u0443 Split In Batches, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 items \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 node \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438.\"\\n00:53: \"\u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 API \u0441 \u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438.\""
            }
          ]
        },
        "batching": {
          "batchSize": 1,
          "delayBetweenBatches": 1000
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        2528,
        2704
      ],
      "id": "cc4fe81f-8b51-4f9f-b2c7-df053b8b3930",
      "name": "Transcript Editor3",
      "retryOnFail": true
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"text\": \"\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        2720,
        2864
      ],
      "id": "4be1441e-e9d0-498b-9850-7ab0e6859870",
      "name": "Structured Output Parser9"
    },
    {
      "parameters": {
        "model": "deepseek-reasoner",
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        3872,
        2992
      ],
      "id": "a6fc96e5-2548-4bf8-aa6a-e395d4b8437d",
      "name": "DeepSeek Chat Model10",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 6000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432): \n\n{{ $json.readable_text }}\n",
        "hasOutputParser": true,
        "needsFallback": true,
        "messages": {
          "messageValues": [
            {
              "message": "=\u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438, \u044d\u0442\u043e \u043c\u043e\u043d\u043e\u043b\u043e\u0433 \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438\u043b\u0438 \u0434\u0438\u0430\u043b\u043e\u0433/\u0431\u0435\u0441\u0435\u0434\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u044e\u0434\u0435\u0439. \n\n## \u041f\u0420\u0418\u0417\u041d\u0410\u041a\u0418 \u0414\u0418\u0410\u041b\u041e\u0413\u0410: \n\n* \u0421\u043c\u0435\u043d\u0430 \u0441\u0442\u0438\u043b\u044f \u0440\u0435\u0447\u0438 \n\n* \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0433\u043e\u043b\u043e\u0441\u0430\u043c\u0438 \n\n* \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f (\"\u0442\u044b \u0441\u043a\u0430\u0437\u0430\u043b\", \"\u043a\u0430\u043a \u0442\u044b \u0434\u0443\u043c\u0430\u0435\u0448\u044c\") \n\n* \u042f\u0432\u043d\u0430\u044f \u0441\u043c\u0435\u043d\u0430 \u0442\u0435\u043c/\u043c\u043d\u0435\u043d\u0438\u0439  \n\n## \u041f\u0420\u0418\u0417\u041d\u0410\u041a\u0418 \u041c\u041e\u041d\u041e\u041b\u041e\u0413\u0410: \n\n* \u0415\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \n\n* \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \n\n* \u0410\u0432\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043b\u0438\u0446\u0430 \u0431\u0435\u0437 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u043e\u0432  \n\n\u0412\u0435\u0440\u043d\u0438 \u0421\u0422\u0420\u041e\u0413\u041e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0411\u0415\u0417 markdown \u0431\u043b\u043e\u043a\u043e\u0432, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:\n{\n  \"content_type\": \"monologue\" \u0438\u043b\u0438 \"dialogue\",\n  \"speakers_count\": \u0447\u0438\u0441\u043b\u043e,\n  \"confidence\": \"high/medium/low\",\n  \"reasoning\": \"\u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435\"\n}\n\n\u041d\u0415 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 json \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442!\n\n\u274c \u041d\u0415\u041f\u0420\u0410\u0412\u0418\u041b\u042c\u041d\u041e:\n{\"text\": \"{\\\"content_type\\\": \\\"dialogue\\\"}\"}\n{\"result\": {\"content_type\": \"dialogue\"}}\n```json\\n{\"content_type\": \"dialogue\"}\\n```\n\n\u2705 \u041f\u0420\u0410\u0412\u0418\u041b\u042c\u041d\u041e:\n{\"content_type\": \"dialogue\", \"speakers_count\": 2, \"confidence\": \"high\", \"reasoning\": \"...\"}\n"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        3792,
        2768
      ],
      "id": "593257e4-02fd-4720-b5eb-42fe6adca4de",
      "name": "Detect Dialogue vs Monologue2",
      "retryOnFail": true
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"content_type\": \"string\",\n  \"speakers_count\": \"number\",\n  \"confidence\": \"string\",\n  \"reasoning\": \"string\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        4000,
        2992
      ],
      "id": "5d76b449-c064-47c8-9cfc-8687bb2c054e",
      "name": "Structured Output Parser10"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        3744,
        2992
      ],
      "id": "14f05ad9-7718-4b96-85b0-7d2c55cc78f1",
      "name": "OpenAI Chat Model14",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u0430: \n{{ $('YouTube Video Info1').first().json.author_name }}\n\n## \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e: \n{{ $('YouTube Video Info1').first().json.title }}\n\n## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f:\n{{ $json.readable_text }}\n\n",
        "hasOutputParser": true,
        "needsFallback": true,
        "messages": {
          "messageValues": [
            {
              "message": "# \u0422\u044b - \u044d\u043a\u0441\u043f\u0435\u0440\u0442 \u043f\u043e speaker diarization (\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0441\u043f\u0438\u043a\u0435\u0440\u043e\u0432 \u0432 \u0430\u0443\u0434\u0438\u043e \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f\u0445).\n\n## \u0422\u0412\u041e\u0418 \u0417\u0410\u0414\u0410\u0427\u0418:\n\n* \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0441\u043c\u0435\u043d\u044b \u0441\u043f\u0438\u043a\u0435\u0440\u0430\n\n* \u0420\u0430\u0437\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e\n\n## \u041a\u0420\u0418\u0422\u0415\u0420\u0418\u0418 \u0421\u041c\u0415\u041d\u042b \u0421\u041f\u0418\u041a\u0415\u0420\u0410:\n\n### \u2705 \u042f\u0412\u041d\u042b\u0415 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0441\u043c\u0435\u043d\u044b:\n\n* \u0412\u043e\u043f\u0440\u043e\u0441-\u043e\u0442\u0432\u0435\u0442 (\"\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?\" \u2192 \"\u041e\u0431\u044a\u044f\u0441\u043d\u044e\")\n\n* \u041f\u0440\u044f\u043c\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 (\"\u0422\u044b \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b...\", \"\u0427\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0448\u044c?\")\n\n* \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (\"\u042f \u0421\u0430\u0448\u0430\", \"\u0410 \u044f \u0433\u043e\u0441\u0442\u044c \u0418\u0432\u0430\u043d\")\n\n* \u0420\u0435\u0437\u043a\u0430\u044f \u0441\u043c\u0435\u043d\u0430 \u0441\u0442\u0438\u043b\u044f \u0440\u0435\u0447\u0438 (\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u2194 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043d\u044b\u0439)\n\n* \u041f\u0435\u0440\u0435\u0431\u0438\u0432\u0430\u043d\u0438\u0435, \u0432\u043a\u043b\u0438\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 \u0440\u0435\u0447\u044c\n\n### \u274c \u041d\u0415 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043c\u0435\u043d\u043e\u0439 \u0441\u043f\u0438\u043a\u0435\u0440\u0430:\n\n* \u0420\u0438\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 (\"\u0418 \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442? \u0410 \u0432\u043e\u0442 \u0447\u0442\u043e...\")\n\n* \u0421\u043c\u0435\u043d\u0430 \u0442\u0435\u043c\u044b \u0432 \u043c\u043e\u043d\u043e\u043b\u043e\u0433\u0435\n\n* \u0426\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\"\u041e\u043d \u0441\u043a\u0430\u0437\u0430\u043b: '\u043f\u0440\u0438\u0432\u0435\u0442'\" - \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0441\u043f\u0438\u043a\u0435\u0440)\n\n* \u041f\u0430\u0443\u0437\u044b \u0438 \u043c\u0435\u0436\u0434\u043e\u043c\u0435\u0442\u0438\u044f (\"\u0425\u043c... \u043d\u0443... \u043a\u043e\u0440\u043e\u0447\u0435...\")\n\n## \u041f\u0420\u0410\u0412\u0418\u041b\u0410 \u0424\u041e\u0420\u041c\u0410\u0422\u0418\u0420\u041e\u0412\u0410\u041d\u0418\u042f:\n\n1. \u0424\u043e\u0440\u043c\u0430\u0442: [\u0421\u043f\u0438\u043a\u0435\u0440 N] MM:SS: \"\u0442\u0435\u043a\u0441\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0438\"\n\n2. \u041a\u0430\u0436\u0434\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 - \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n\n3. \u0413\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0439 \u043f\u043e\u0434\u0440\u044f\u0434 \u0438\u0434\u0443\u0449\u0438\u0435 \u0444\u0440\u0430\u0437\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u043a\u0435\u0440\u0430 \u0432 \u041e\u0414\u041d\u0423 \u0440\u0435\u043f\u043b\u0438\u043a\u0443\n\n4. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0439 \u0442\u0430\u0439\u043c\u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0441\u043f\u0438\u043a\u0435\u0440\u0430\n\n5. \u0415\u0441\u043b\u0438 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0448\u044c\u0441\u044f - \u041d\u0415 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439 (\u043b\u0443\u0447\u0448\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u0438\u043a\u0435\u0440)\n\n\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439 **\u0422\u041e\u041b\u042c\u041a\u041e** \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u0443\u044e \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432.\n\n## \u0424\u041e\u0420\u041c\u0410\u0422 \u0412\u042b\u0412\u041e\u0414\u0410:\n\n\u0412\u0435\u0440\u043d\u0438 **\u0421\u0422\u0420\u041e\u0413\u041e** JSON \u0431\u0435\u0437 markdown \u0431\u043b\u043e\u043a\u043e\u0432:\n{\n  \"text\": \"\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n\n**\u041d\u0415** \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 ```json \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442!\n"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "10.5: '\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0421\u0430\u0448\u0430' 25.3: '\u0410 \u044f \u0433\u043e\u0441\u0442\u044c \u0418\u0432\u0430\u043d' 40.1: '\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438 \u043e n8n"
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "[\u0421\u043f\u0438\u043a\u0435\u0440 1] 10.5: '\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0421\u0430\u0448\u0430' \n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 25.3: '\u0410 \u044f \u0433\u043e\u0441\u0442\u044c \u0418\u0432\u0430\u043d'   \n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 40.1: '\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438 \u043e n8n'"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "00:00: \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e Vibe Business.\"\\n00:03: \"\u041f\u0440\u0438\u0432\u0435\u0442! \u0410 \u044f \u041d\u0438\u043a\u043e\u043b\u0430\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u043e\u0434\u0435 Merge. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439\"\\n00:05: \"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\"\\n00:07: \"\u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\"\\n00:09: \"\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\"\\n00:11: \"\u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423\"\\n00:13: \"\u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e\"\\n00:16: \"\u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\"\\n"
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "\"[\u0421\u043f\u0438\u043a\u0435\u0440 1] 00:00: \\\"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u0421\u0430\u0448\u0430, \u044d\u0442\u043e Vibe Business.\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:03: \\\"\u041f\u0440\u0438\u0432\u0435\u0442! \u0410 \u044f \u041d\u0438\u043a\u043e\u043b\u0430\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e node Merge. \u042d\u0442\u043e \u0442\u0430\u043a\u043e\u0439\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:05: \\\"\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e \u0433\u043e\u0440\u0434\u044b\u0439 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:07: \\\"\u0434\u0435\u043b\u0430\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:09: \\\"\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:11: \\\"\u0441 \u0442\u0430\u043a\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u0423\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:13: \\\"\u043d\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u043e\\\"\\n[\u0421\u043f\u0438\u043a\u0435\u0440 2] 00:16: \\\"\u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430.\\\"\\n\""
            }
          ]
        },
        "batching": {
          "batchSize": 1,
          "delayBetweenBatches": 1000
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        5216,
        2768
      ],
      "id": "82bb41ad-66a9-4ad4-b19e-d98d30f2967c",
      "name": "Edit Dialog3",
      "retryOnFail": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0.3
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        5152,
        2992
      ],
      "id": "e39f3926-fc47-483d-b109-3504b4cf782a",
      "name": "OpenAI Chat Model15",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"text\": \"\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438\"\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        5408,
        2992
      ],
      "id": "11fc4789-8ce0-45c8-89f1-9298feb69a67",
      "name": "Structured Output Parser11"
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        5280,
        2992
      ],
      "id": "0a386b30-2594-4c29-957c-e67ef1c5948a",
      "name": "DeepSeek Chat Model11",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "18ee1bf2-8f6b-497b-a369-cd630118b8d1",
              "name": "output",
              "value": "={{ $json.output }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        4096,
        2688
      ],
      "id": "078c7092-e4f8-4108-8da3-8a193e0d6548",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=## \u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 6000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432): \n\n{{ $json.readable_text }}\n",
        "hasOutputParser": true,
        "needsFallback": true,
        "messages": {
          "messageValues": [
            {
              "message": "=\u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438, \u044d\u0442\u043e \u043c\u043e\u043d\u043e\u043b\u043e\u0433 \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438\u043b\u0438 \u0434\u0438\u0430\u043b\u043e\u0433/\u0431\u0435\u0441\u0435\u0434\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u044e\u0434\u0435\u0439. \n\n## \u041f\u0420\u0418\u0417\u041d\u0410\u041a\u0418 \u0414\u0418\u0410\u041b\u041e\u0413\u0410: \n\n* \u0421\u043c\u0435\u043d\u0430 \u0441\u0442\u0438\u043b\u044f \u0440\u0435\u0447\u0438 \n\n* \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0433\u043e\u043b\u043e\u0441\u0430\u043c\u0438 \n\n* \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f (\"\u0442\u044b \u0441\u043a\u0430\u0437\u0430\u043b\", \"\u043a\u0430\u043a \u0442\u044b \u0434\u0443\u043c\u0430\u0435\u0448\u044c\") \n\n* \u042f\u0432\u043d\u0430\u044f \u0441\u043c\u0435\u043d\u0430 \u0442\u0435\u043c/\u043c\u043d\u0435\u043d\u0438\u0439  \n\n## \u041f\u0420\u0418\u0417\u041d\u0410\u041a\u0418 \u041c\u041e\u041d\u041e\u041b\u041e\u0413\u0410: \n\n* \u0415\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \n\n* \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \n\n* \u0410\u0432\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043b\u0438\u0446\u0430 \u0431\u0435\u0437 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u043e\u0432  \n\n\u0412\u0435\u0440\u043d\u0438 \u0421\u0422\u0420\u041e\u0413\u041e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0411\u0415\u0417 markdown \u0431\u043b\u043e\u043a\u043e\u0432, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:\n{\n  \"content_type\": \"monologue\" \u0438\u043b\u0438 \"dialogue\",\n  \"speakers_count\": \u0447\u0438\u0441\u043b\u043e,\n  \"confidence\": \"high/medium/low\",\n  \"reasoning\": \"\u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435\"\n}\n\n\u041d\u0415 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 json \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u043a\u0441\u0442!\n\n\u274c \u041d\u0415\u041f\u0420\u0410\u0412\u0418\u041b\u042c\u041d\u041e:\n{\"text\": \"{\\\"content_type\\\": \\\"dialogue\\\"}\"}\n{\"result\": {\"content_type\": \"dialogue\"}}\n```json\\n{\"content_type\": \"dialogue\"}\\n```\n\n\u2705 \u041f\u0420\u0410\u0412\u0418\u041b\u042c\u041d\u041e:\n{\"content_type\": \"dialogue\", \"speakers_count\": 2, \"confidence\": \"high\", \"reasoning\": \"...\"}\n"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        3408,
        2704
      ],
      "id": "a33e4a05-14eb-4628-8977-826ef1ca1838",
      "name": "Detect Dialogue vs Monologue3",
      "retryOnFail": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.largestPhoto.file_id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        528,
        3024
      ],
      "id": "084fc41f-73ed-47f8-b913-79dba94d0358",
      "name": "Get a file",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-pro",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        704,
        3680
      ],
      "id": "e8873860-9f47-48e7-874b-2015c466f0de",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "64c05a0a-4fc8-4709-9589-faadc0d891cf",
                    "leftValue": "={{ $json.output.raw_text }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "empty",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "empty_text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.output.document_type }}",
                    "rightValue": "receipt",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "d98f519f-5bdd-46da-8834-d761cf3396d7"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "receipt"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "7bbf9fc4-06d8-433e-92a5-96adee7a4f82",
                    "leftValue": "={{ $json.output.document_type }}",
                    "rightValue": "invoice",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "invoice"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "347ff0e4-ebc2-4785-841e-98453ba36a33",
                    "leftValue": "={{ $json.output.document_type }}",
                    "rightValue": "contract",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "contract"
            }
          ]
        },
        "looseTypeValidation": true,
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        1184,
        3488
      ],
      "id": "62575d28-348a-4ae3-816d-d33e23cadf1f",
      "name": "Switch2"
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        1408,
        3248
      ],
      "id": "d2da7013-070d-440a-8c0d-fee8bd92afc4",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"document_type\": {\n      \"type\": \"string\",\n      \"enum\": [\"receipt\", \"invoice\", \"contract\", \"screenshot\"],\n      \"description\": \"\u0422\u0438\u043f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\"\n    },\n    \"raw_text\": {\n      \"type\": \"string\",\n      \"description\": \"\u0412\u0435\u0441\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\"\n    }\n  },\n  \"required\": [\"document_type\", \"raw_text\"]\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        832,
        3680
      ],
      "id": "9143ff4e-3a30-411b-86dd-a49e1dcfc7aa",
      "name": "Structured Output Parser12"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "={\n  \"type\": \"object\",\n  \"properties\": {\n    \"document_type\": {\n      \"type\": \"string\",\n      \"const\": \"receipt\"\n    },\n    \"merchant_name\": {\"type\": \"string\"},\n    \"merchant_address\": {\"type\": \"string\"},\n    \"merchant_inn\": {\"type\": \"string\"},\n    \"date\": {\"type\": \"string\", \"description\": \"DD.MM.YYYY\"},\n    \"time\": {\"type\": \"string\", \"description\": \"HH:MM\"},\n    \"receipt_number\": {\"type\": \"string\"},\n    \"items\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\"type\": \"string\"},\n          \"quantity\": {\"type\": \"number\"},\n          \"price\": {\"type\": \"string\"},\n          \"total\": {\"type\": \"string\"}\n        },\n        \"required\": [\"name\", \"total\"]\n      }\n    },\n    \"total_amount\": {\"type\": \"string\"},\n    \"tax\": {\"type\": \"string\"},\n    \"payment_method\": {\"type\": \"string\"}\n  },\n  \"required\": [\"document_type\", \"merchant_name\", \"date\", \"items\", \"total_amount\"]\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1808,
        3248
      ],
      "id": "8acb75b6-61d5-4b2b-a23c-0dac0fa4cc64",
      "name": "Structured Output Parser13"
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        1408,
        3392
      ],
      "id": "07f23f71-78b0-49ca-bba1-15fa88016b5c",
      "name": "Google Gemini Chat Model2",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "={\n  \"type\": \"object\",\n  \"properties\": {\n    \"document_type\": {\"type\": \"string\", \"const\": \"invoice\"},\n    \"doc_type_name\": {\"type\": \"string\", \"description\": \"\u043d\u0430\u043a\u043b\u0430\u0434\u043d\u0430\u044f/\u0441\u0447\u0435\u0442/\u0441\u0447\u0435\u0442-\u0444\u0430\u043a\u0442\u0443\u0440\u0430\"},\n    \"doc_number\": {\"type\": \"string\"},\n    \"doc_date\": {\"type\": \"string\"},\n    \n    \"sender_name\": {\"type\": \"string\"},\n    \"sender_inn\": {\"type\": \"string\"},\n    \"sender_kpp\": {\"type\": \"string\"},\n    \"sender_address\": {\"type\": \"string\"},\n    \"sender_phone\": {\"type\": \"string\"},\n    \"sender_email\": {\"type\": \"string\"},\n    \n    \"recipient_name\": {\"type\": \"string\"},\n    \"recipient_inn\": {\"type\": \"string\"},\n    \"recipient_kpp\": {\"type\": \"string\"},\n    \"recipient_address\": {\"type\": \"string\"},\n    \"recipient_phone\": {\"type\": \"string\"},\n    \"recipient_email\": {\"type\": \"string\"},\n    \n    \"items\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\"type\": \"string\"},\n          \"sku\": {\"type\": \"string\"},\n          \"quantity\": {\"type\": \"number\"},\n          \"unit\": {\"type\": \"string\"},\n          \"price\": {\"type\": \"string\"},\n          \"total\": {\"type\": \"string\"}\n        },\n        \"required\": [\"name\", \"quantity\", \"total\"]\n      }\n    },\n    \"total_amount\": {\"type\": \"string\"},\n    \"vat\": {\"type\": \"string\"}\n  },\n  \"required\": [\"document_type\", \"sender_name\", \"recipient_name\", \"items\", \"total_amount\"]\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1824,
        3392
      ],
      "id": "e8e59b18-3282-4333-8da2-6413728d6dd8",
      "name": "Structured Output Parser14"
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        1408,
        3568
      ],
      "id": "cb46e80b-e989-4460-a8f1-797d1fcf15f2",
      "name": "Google Gemini Chat Model4",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0442\u043e\u0440\u0430\nconst input = $input.item.json;\n\n// \u041f\u0430\u0440\u0441\u0438\u043c \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0430\nlet parsed;\nif (typeof input === 'string') {\n  try {\n    parsed = JSON.parse(input);\n  } catch (e) {\n    const match = input.match(/\\{[\\s\\S]*\\}/);\n    if (match) {\n      parsed = JSON.parse(match[0]);\n    } else {\n      return [{\n        json: {\n          formatted_message: `\u274c \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 LLM`,\n          raw_data: input\n        }\n      }];\n    }\n  }\n} else {\n  parsed = input;\n}\n\n// \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435\nconst data = parsed.output || parsed;\n\n// \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nlet message = '';\nlet result = {\n  json: {\n    formatted_message: '',\n    raw_data: data,\n    document_type: data.document_type\n  }\n};\n\nswitch(data.document_type) {\n  \n  case 'receipt':\n    message = `\ud83e\uddfe \u0427\u0415\u041a\\n\\n`;\n    message += `\u041c\u0430\u0433\u0430\u0437\u0438\u043d: <code>${data.merchant_name}</code>\\n`;\n    if (data.merchant_address) message += `\u0410\u0434\u0440\u0435\u0441: <code>${data.merchant_address}</code>\\n`;\n    if (data.merchant_inn) message += `\u0418\u041d\u041d: <code>${data.merchant_inn}</code>\\n`;\n    \n    message += `\\n\ud83d\udcc5 \u0414\u0430\u0442\u0430: <code>${data.date}</code>`;\n    if (data.time) message += `\\n\u23f0 \u0412\u0440\u0435\u043c\u044f: <code>${data.time}</code>`;\n    if (data.receipt_number) message += `\\n\u2116 \u0447\u0435\u043a\u0430: <code>${data.receipt_number}</code>`;\n    \n    message += `\\n\\n\ud83d\udce6 \u0422\u043e\u0432\u0430\u0440\u044b:\\n`;\n    data.items.forEach((item, i) => {\n      message += `${i+1}. <code>${item.name}</code>\\n`;\n      message += `   <code>${item.quantity || 1} \u0448\u0442 \u00d7 ${item.price || item.total} = ${item.total}</code>\\n`;\n    });\n    \n    message += `\\n\ud83d\udcb0 \u0418\u0422\u041e\u0413\u041e: <code>${data.total_amount}</code>\\n`;\n    if (data.tax) message += `\u041d\u0414\u0421: <code>${data.tax}</code>\\n`;\n    if (data.payment_method) message += `\\n\ud83d\udcb3 \u041e\u043f\u043b\u0430\u0442\u0430: <code>${data.payment_method}</code>`;\n    \n    result.json.formatted_message = message;\n    break;\n    \n  case 'invoice':\n    message = `\ud83d\udccb ${data.doc_type_name?.toUpperCase() || '\u041d\u0410\u041a\u041b\u0410\u0414\u041d\u0410\u042f'}\\n\\n`;\n    message += `\u2116 <code>${data.doc_number}</code> \u043e\u0442 <code>${data.doc_date}</code>\\n\\n`;\n    \n    message += `\ud83d\udce4 \u041e\u0422\u041f\u0420\u0410\u0412\u0418\u0422\u0415\u041b\u042c:\\n`;\n    message += `<code>${data.sender_name}</code>\\n`;\n    if (data.sender_inn) message += `\u0418\u041d\u041d: <code>${data.sender_inn}</code>`;\n    if (data.sender_kpp) message += ` | \u041a\u041f\u041f: <code>${data.sender_kpp}</code>`;\n    if (data.sender_inn || data.sender_kpp) message += `\\n`;\n    if (data.sender_address) message += `\ud83d\udccd <code>${data.sender_address}</code>\\n`;\n    if (data.sender_phone) message += `\ud83d\udcde <code>${data.sender_phone}</code>\\n`;\n    if (data.sender_email) message += `\ud83d\udce7 <code>${data.sender_email}</code>\\n`;\n    \n    message += `\\n\ud83d\udce5 \u041f\u041e\u041b\u0423\u0427\u0410\u0422\u0415\u041b\u042c:\\n`;\n    message += `<code>${data.recipient_name}</code>\\n`;\n    if (data.recipient_inn) message += `\u0418\u041d\u041d: <code>${data.recipient_inn}</code>`;\n    if (data.recipient_kpp) message += ` | \u041a\u041f\u041f: <code>${data.recipient_kpp}</code>`;\n    if (data.recipient_inn || data.recipient_kpp) message += `\\n`;\n    if (data.recipient_address) message += `\ud83d\udccd <code>${data.recipient_address}</code>\\n`;\n    if (data.recipient_phone) message += `\ud83d\udcde <code>${data.recipient_phone}</code>\\n`;\n    if (data.recipient_email) message += `\ud83d\udce7 <code>${data.recipient_email}</code>\\n`;\n    \n    message += `\\n\ud83d\udce6 \u041f\u041e\u0417\u0418\u0426\u0418\u0418:\\n`;\n    data.items.forEach((item, i) => {\n      message += `${i+1}. <code>${item.name}</code>\\n`;\n      if (item.sku) message += `   \u0410\u0440\u0442\u0438\u043a\u0443\u043b: <code>${item.sku}</code>\\n`;\n      message += `   <code>${item.quantity} ${item.unit || '\u0448\u0442'} \u00d7 ${item.price} = ${item.total}</code>\\n`;\n    });\n    \n    message += `\\n\ud83d\udcb0 \u0418\u0422\u041e\u0413\u041e: <code>${data.total_amount}</code>\\n`;\n    if (data.vat) message += `\u041d\u0414\u0421: <code>${data.vat}</code>\\n`;\n    \n    result.json.formatted_message = message;\n    break;\n    \n  case 'contract':\n    message = `\ud83d\udcc4 \u0414\u041e\u0413\u041e\u0412\u041e\u0420\\n\\n`;\n    if (data.title) {\n      message += `<b>${data.title}</b>\\n\\n`;\n    }\n    \n    message += `\ud83d\udccb \u0422\u0435\u043a\u0441\u0442 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430:\\n\\n`;\n    message += `<code>${data.full_text || '\u0422\u0435\u043a\u0441\u0442 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d'}</code>`;\n    \n    result.json.formatted_message = message;\n    break;\n\n  case 'screenshot':\n    let textContent = '';\n    \n    if (data.text) {\n      if (typeof data.text === 'string' && data.text.includes('```json')) {\n        const match = data.text.match(/\\{[\\s\\S]*\\}/);\n        if (match) {\n          const parsed = JSON.parse(match[0]);\n          textContent = parsed.text || parsed.raw_text || data.text;\n        } else {\n          textContent = data.text;\n        }\n      } else {\n        textContent = data.text;\n      }\n    } else if (data.raw_text) {\n      textContent = data.raw_text;\n    } else if (data.output && data.output.raw_text) {\n      textContent = data.output.raw_text;\n    } else {\n      textContent = JSON.stringify(data);\n    }\n    \n    message = `\ud83d\udcf1 \u0422\u0415\u041a\u0421\u0422 \u0421 \u0418\u0417\u041e\u0411\u0420\u0410\u0416\u0415\u041d\u0418\u042f\\n\\n`;\n    message += `<code>${textContent}</code>`;\n    \n    result.json.formatted_message = message;\n    break;\n    \n  default:\n    message = `\u2753 \u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0442\u0438\u043f: ${data.document_type}`;\n    result.json.formatted_message = message;\n}\n\nreturn [result];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2272,
        3600
      ],
      "id": "e9835ab2-875e-47d5-a898-51f80dd54233",
      "name": "Code in JavaScript5"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"document_type\": {\"type\": \"string\", \"const\": \"contract\"},\n    \"title\": {\"type\": \"string\", \"description\": \"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435: \u0414\u0430\u0442\u0430 + \u0422\u0438\u043f \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 + \u041f\u0440\u0435\u0434\u043c\u0435\u0442\"},\n    \"full_text\": {\"type\": \"string\", \"description\": \"\u041f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430\"}\n  },\n  \"required\": [\"document_type\", \"title\", \"full_text\"]\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1824,
        3568
      ],
      "id": "ef261a57-0ad2-425b-a309-7e017c63be3b",
      "name": "Structured Output Parser16"
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        2096,
        3568
      ],
      "id": "fde4e07b-397e-485f-a59d-9dbd1d6a7598",
      "name": "Google Gemini Chat Model5",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.formatted_message }}",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "HTML"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2448,
        3600
      ],
      "id": "80f33455-e51d-4c69-a547-eb57adfcedd4",
      "name": "Send a text message1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        2096,
        3392
      ],
      "id": "76aa4e2f-5c9f-481b-a32d-04434d127559",
      "name": "Google Gemini Chat Model6",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        2080,
        3248
      ],
      "id": "b5e283ae-606b-4f90-aabf-76a96c431c43",
      "name": "Google Gemini Chat Model9",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        816,
        3856
      ],
      "id": "6c01a986-577a-459d-8b8f-6a95efe3bf6b",
      "name": "DeepSeek Chat Model15",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const input = $input.item.json;\n\nconst photos = input.message.photo;\nconst largestPhoto = photos[photos.length - 1];\n\nreturn [\n  {\n    json: {\n      \"largestPhoto\": largestPhoto,\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        320,
        2944
      ],
      "id": "df8815c0-f91b-466e-9dd2-b9a8fc7a4ca4",
      "name": "Get largestPhoto"
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "file": "CgACAgIAAxkBAAIBeWkkHOcv5KyiK6CpJasyf5mNgad-AALFiwACDnsgSVgcLMKryg-1NgQ",
        "additionalFields": {
          "caption": "\u041e\u0443\u2026 \u043c\u0438\u043b\u044b\u0439, \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 YouTube-\u0432\u0438\u0434\u0435\u043e \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438 \ud83d\uddbc\ufe0f\ud83d\udc8b \n\n\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u043e\u043c \u2014 \u044f \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442: \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u044b, \u0447\u0435\u043a\u0438, \u0438\u043d\u0432\u043e\u0439\u0441\u044b, \u0441\u043a\u0440\u0438\u043d\u044b \u0438 \u0432\u0441\u0451 \u0442\u0430\u043a\u043e\u0435 \u2728\u2328\ufe0f  \n\n\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c \u0433\u043e\u0442\u043e\u0432 \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0442\u0435\u0431\u044f \u043b\u0438\u0447\u043d\u043e: \n\ud83d\udc49 https://t.me/vibe_bus_chat"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1408,
        3088
      ],
      "id": "83fc4ad9-79d4-4f4e-9f79-9e27e0351d27",
      "name": "Send an animated file3",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAnimation",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "file": "CgACAgIAAxkBAAPYaSGS-iznAAF_DQ4gAvZyW7Jq5cbjAAIBhAACHkMQSRh3PIy3q1ztNgQ",
        "additionalFields": {
          "caption": "=\u041e\u0443\u2026 \u043c\u0438\u043b\u044b\u0439, \u043f\u0440\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044f \ud83d\ude14\ud83e\udd8c\u2728\n\u042f \u0443\u0432\u0438\u0434\u0435\u043b\u0430, \u0447\u0442\u043e \u0442\u044b \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443,\n\u043d\u043e \u043c\u043e\u0439 \u043d\u0435\u0436\u043d\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u0431\u0430\u0442\u043e\u0440 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u0441\u044b\u043b\u043e\u0447\u043a\u0430\u043c\u0438\u2026 \u043e\u043d \u0441\u043c\u0443\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \ud83e\udd26\u200d\u2640\ufe0f\ud83d\udcab\n\n\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c, \u0447\u0442\u043e\u0431\u044b \u044f \u0432\u044b\u0442\u044f\u043d\u0443\u043b\u0430 \u0442\u0435\u043a\u0441\u0442, \u043f\u0440\u0438\u0448\u043b\u0438 \u0441\u0430\u043c\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u043c \u2014\n\u0438 \u044f \u0441\u043b\u0430\u0434\u043a\u043e \u043f\u043e\u0441\u0442\u0443\u0447\u0443 \u043a\u043e\u043f\u044b\u0442\u0446\u0430\u043c\u0438 \u043f\u043e \u043a\u043b\u0430\u0432\u0438\u0448\u0430\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0431\u044f \ud83d\ude18\u2328\ufe0f\u2728\n\n\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u2014\n\u0441\u043a\u0430\u0436\u0438 \u0432\u0441\u0451 \u043c\u043e\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u044f\u043c\u043e \u0437\u0434\u0435\u0441\u044c:\n\ud83d\udc49 https://t.me/vibe_bus_chat"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        736,
        2768
      ],
      "id": "b785cea6-8457-4915-a81d-274c08760e79",
      "name": "Send Sorry For Link",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438 \u0442\u0438\u043f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0438 \u0432\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "# \u0422\u044b \u0430\u0433\u0435\u043d\u0442-\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 OCR.\n\n## \u0422\u0432\u043e\u044f \u0437\u0430\u0434\u0430\u0447\u0430:\n1. **\u041f\u0440\u043e\u0432\u0435\u0440\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:**\n   - \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u041d\u0415 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2192 \u0432\u0435\u0440\u043d\u0438: {\"document_type\": \"not_image\", \"raw_text\": \"ERROR: Input is not an image\"}\n\n2. **\u0418\u0437\u0432\u043b\u0435\u043a\u0438 \u0442\u0435\u043a\u0441\u0442:**\n   - \u0422\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044c \u0412\u0421\u0401 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430\n   - \u0418\u0449\u0438 \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0437\u0434\u0435: \u0432 \u0446\u0435\u043d\u0442\u0440\u0435, \u043f\u043e \u043a\u0440\u0430\u044f\u043c, \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435\n\n3. **\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438 \u0442\u0438\u043f:**\n   - \u0415\u0441\u043b\u0438 \u041d\u0415\u0422 \u041d\u0418\u041a\u0410\u041a\u041e\u0413\u041e \u0442\u0435\u043a\u0441\u0442\u0430 \u2192 {\"document_type\": \"empty\", \"raw_text\": \"\"}\n   - \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u044d\u0442\u043e \u0447\u0435\u043a \u2192 \"receipt\"\n   - \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u044d\u0442\u043e \u0441\u0447\u0451\u0442/\u0438\u043d\u0432\u043e\u0439\u0441 \u2192 \"invoice\"  \n   - \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u044d\u0442\u043e \u0434\u043e\u0433\u043e\u0432\u043e\u0440 \u2192 \"contract\"\n   - \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u044d\u0442\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u2192 \"screenshot\"\n\n## \u041a\u0420\u0418\u0422\u0418\u0427\u0415\u0421\u041a\u0418 \u0412\u0410\u0416\u041d\u041e:\n- \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044c \u041d\u0410\u041b\u0418\u0427\u0418\u0415 \u0442\u0435\u043a\u0441\u0442\u0430\n- \u0422\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u0415\u0421\u0422\u042c - \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0439 \u0442\u0438\u043f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\n- \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u041d\u0415\u0422 - \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439 \"empty\"\n\n## \u0424\u041e\u0420\u041c\u0410\u0422 \u041e\u0422\u0412\u0415\u0422\u0410:\n{\n  \"document_type\": \"empty|receipt|invoice|contract|screenshot\",\n  \"raw_text\": \"\u0432\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u043b\u0438 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\"\n}"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "messageType": "imageBinary"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        832,
        3520
      ],
      "id": "e07f6d50-0345-441d-b733-fe7fbe33a6fe",
      "name": "Classifier"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0447\u0435\u043a\u0430:\n\n{{ $('Classifier').item.json.output.raw_text }}\n",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "=# \u0422\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0447\u0435\u043a\u043e\u0432.\n\n\u0418\u0437 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437\u0432\u043b\u0435\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 JSON \u0444\u043e\u0440\u043c\u0430\u0442.\n\n# \u0412\u0410\u0416\u041d\u041e:\n\n* \u0426\u0435\u043d\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0439 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441 \u0432\u0430\u043b\u044e\u0442\u043e\u0439\n\n* \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0430 \u0438\u0449\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\n\n* \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0439 \u0412\u0421\u0415 \u0442\u043e\u0432\u0430\u0440\u044b"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        1552,
        3232
      ],
      "id": "c5b3c695-7f06-4c01-a2a9-5060d1c1a092",
      "name": "Receipt Processor"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430:\n\n{{ $('Classifier').item.json.output.raw_text }}\n",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "=# \u0422\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0438 \u0441\u0447\u0435\u0442\u043e\u0432.\n\n\u0418\u0437\u0432\u043b\u0435\u043a\u0438 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 JSON \u0444\u043e\u0440\u043c\u0430\u0442.\n\n## \u0412\u0410\u0416\u041d\u041e:\n\n1. **\u0422\u0438\u043f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430** - \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438 \u0442\u043e\u0447\u043d\u043e (\u043d\u0430\u043a\u043b\u0430\u0434\u043d\u0430\u044f/\u0441\u0447\u0435\u0442/\u0441\u0447\u0435\u0442-\u0444\u0430\u043a\u0442\u0443\u0440\u0430)\n2. **\u041d\u043e\u043c\u0435\u0440 \u0438 \u0434\u0430\u0442\u0430** - \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\n3. **\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c** - \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0418\u041d\u041d, \u041a\u041f\u041f (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c), \u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b\n4. **\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c** - \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0418\u041d\u041d, \u041a\u041f\u041f (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c), \u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b\n5. **\u041f\u043e\u0437\u0438\u0446\u0438\u0438** - \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438:\n   - \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u0430/\u0443\u0441\u043b\u0443\u0433\u0438\n   - \u0410\u0440\u0442\u0438\u043a\u0443\u043b (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c)\n   - \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)\n   - \u0415\u0434\u0438\u043d\u0438\u0446\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f (\u0448\u0442/\u043a\u0433/\u043c \u0438 \u0442.\u0434.)\n   - \u0426\u0435\u043d\u0430 \u0437\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443\n   - \u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0443\u043c\u043c\u0430 (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)\n6. **\u0418\u0442\u043e\u0433\u043e** - \u043e\u0431\u0449\u0430\u044f \u0441\u0443\u043c\u043c\u0430 (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)\n7. **\u041d\u0414\u0421** - \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "\u0422\u043e\u0432\u0430\u0440\u043d\u0430\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u2116123 \u043e\u0442 15.03.2024. \u041f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u041e\u041e\u041e \u0420\u043e\u0433\u0430 \u0438 \u041a\u043e\u043f\u044b\u0442\u0430, \u0418\u041d\u041d 1234567890, \u041a\u041f\u041f 123456789. \u041f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c \u0418\u041f \u0418\u0432\u0430\u043d\u043e\u0432 \u0418.\u0418., \u0418\u041d\u041d 9876543210. \u0422\u043e\u0432\u0430\u0440: \u0413\u0432\u043e\u0437\u0434\u0438 100\u043c\u043c - 5 \u043a\u0433 \u043f\u043e 150 \u0440\u0443\u0431 = 750 \u0440\u0443\u0431. \u0418\u0442\u043e\u0433\u043e: 750 \u0440\u0443\u0431.\n"
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "{\n  \"document_type\": \"invoice\",\n  \"doc_type_name\": \"\u0422\u043e\u0432\u0430\u0440\u043d\u0430\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u0430\u044f\",\n  \"doc_number\": \"123\",\n  \"doc_date\": \"15.03.2024\",\n  \"sender_name\": \"\u041e\u041e\u041e \u0420\u043e\u0433\u0430 \u0438 \u041a\u043e\u043f\u044b\u0442\u0430\",\n  \"sender_inn\": \"1234567890\",\n  \"sender_kpp\": \"123456789\",\n  \"recipient_name\": \"\u0418\u041f \u0418\u0432\u0430\u043d\u043e\u0432 \u0418.\u0418.\",\n  \"recipient_inn\": \"9876543210\",\n  \"items\": [\n    {\n      \"name\": \"\u0413\u0432\u043e\u0437\u0434\u0438 100\u043c\u043c\",\n      \"quantity\": 5,\n      \"unit\": \"\u043a\u0433\",\n      \"price\": \"150 \u0440\u0443\u0431\",\n      \"total\": \"750 \u0440\u0443\u0431\"\n    }\n  ],\n  \"total_amount\": \"750 \u0440\u0443\u0431\"\n}"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "\u0421\u0447\u0435\u0442 \u043d\u0430 \u043e\u043f\u043b\u0430\u0442\u0443 \u2116456 \u043e\u0442 20.04.2024. \u041f\u0440\u043e\u0434\u0430\u0432\u0435\u0446 \u0418\u041f \u041f\u0435\u0442\u0440\u043e\u0432, \u0418\u041d\u041d 1111111111, \u0430\u0434\u0440\u0435\u0441 \u041c\u043e\u0441\u043a\u0432\u0430 \u0443\u043b. \u041b\u0435\u043d\u0438\u043d\u0430 1. \u041f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c \u041e\u041e\u041e \u0412\u0430\u0441\u0438\u043b\u0435\u043a, \u0418\u041d\u041d 2222222222. \u0423\u0441\u043b\u0443\u0433\u0438: \u041a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u0446\u0438\u044f - 2 \u0447\u0430\u0441\u0430 \u00d7 3000 = 6000. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 - 10 \u0447\u0430\u0441\u043e\u0432 \u00d7 5000 = 50000. \u0418\u0442\u043e\u0433\u043e 56000 \u0440\u0443\u0431, \u0432 \u0442.\u0447. \u041d\u0414\u0421 20% 9333.33 \u0440\u0443\u0431."
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "{\n  \"document_type\": \"invoice\",\n  \"doc_type_name\": \"\u0421\u0447\u0435\u0442 \u043d\u0430 \u043e\u043f\u043b\u0430\u0442\u0443\",\n  \"doc_number\": \"456\",\n  \"doc_date\": \"20.04.2024\",\n  \"sender_name\": \"\u0418\u041f \u041f\u0435\u0442\u0440\u043e\u0432\",\n  \"sender_inn\": \"1111111111\",\n  \"sender_address\": \"\u041c\u043e\u0441\u043a\u0432\u0430 \u0443\u043b. \u041b\u0435\u043d\u0438\u043d\u0430 1\",\n  \"recipient_name\": \"\u041e\u041e\u041e \u0412\u0430\u0441\u0438\u043b\u0435\u043a\",\n  \"recipient_inn\": \"2222222222\",\n  \"items\": [\n    {\n      \"name\": \"\u041a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u0446\u0438\u044f\",\n      \"quantity\": 2,\n      \"unit\": \"\u0447\u0430\u0441\",\n      \"price\": \"3000\",\n      \"total\": \"6000\"\n    },\n    {\n      \"name\": \"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430\",\n      \"quantity\": 10,\n      \"unit\": \"\u0447\u0430\u0441\",\n      \"price\": \"5000\",\n      \"total\": \"50000\"\n    }\n  ],\n  \"total_amount\": \"56000 \u0440\u0443\u0431\",\n  \"vat\": \"9333.33 \u0440\u0443\u0431\"\n}\n"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        1552,
        3392
      ],
      "id": "adf69a07-49ce-4a11-b92b-6307d93ad5fb",
      "name": "Invoice Processor"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u0421\u043e\u0437\u0434\u0430\u0439 \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0433\u043e\u0432\u043e\u0440 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:\n\n{{ $json.output.raw_text }}",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "# \u0422\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0432.\n\n\u0418\u0437\u0432\u043b\u0435\u043a\u0438 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430:\n1. **title** - \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435: \"\u0414\u0430\u0442\u0430 \u0422\u0438\u043f \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 \u041f\u0440\u0435\u0434\u043c\u0435\u0442\"\n2. **full_text** - \u0432\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e\n"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "\u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u043a\u0443\u043f\u043b\u0438-\u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043e\u0442 14.01.2024. \u041f\u0440\u043e\u0434\u0430\u0432\u0435\u0446 \u0418\u0432\u0430\u043d\u043e\u0432 \u0418.\u0418. \u043f\u0440\u043e\u0434\u0430\u0435\u0442 \u041f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044e \u041f\u0435\u0442\u0440\u043e\u0432\u0443 \u041f.\u041f. \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c Toyota Camry \u0437\u0430 500000 \u0440\u0443\u0431\u043b\u0435\u0439..."
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "{\n  \"document_type\": \"contract\",\n  \"title\": \"14.01.2024 \u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u043a\u0443\u043f\u043b\u0438-\u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f Toyota Camry\",\n  \"full_text\": \"\u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u043a\u0443\u043f\u043b\u0438-\u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043e\u0442 14.01.2024. \u041f\u0440\u043e\u0434\u0430\u0432\u0435\u0446 \u0418\u0432\u0430\u043d\u043e\u0432 \u0418.\u0418. \u043f\u0440\u043e\u0434\u0430\u0435\u0442 \u041f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044e \u041f\u0435\u0442\u0440\u043e\u0432\u0443 \u041f.\u041f. \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c Toyota Camry \u0437\u0430 500000 \u0440\u0443\u0431\u043b\u0435\u0439...\"\n}"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "\u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u0430\u0440\u0435\u043d\u0434\u044b \u043d\u0435\u0436\u0438\u043b\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u211645 \u043e\u0442 01.03.2024. \u0410\u0440\u0435\u043d\u0434\u043e\u0434\u0430\u0442\u0435\u043b\u044c \u041e\u041e\u041e \u0420\u043e\u0433\u0430 \u0438 \u041a\u043e\u043f\u044b\u0442\u0430 \u0441\u0434\u0430\u0435\u0442 \u0432 \u0430\u0440\u0435\u043d\u0434\u0443 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u044c\u044e 50\u043c2..."
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "{|  \"document_type\": \"contract\",  \"title\": \"01.03.2024 \u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u0430\u0440\u0435\u043d\u0434\u044b \u043d\u0435\u0436\u0438\u043b\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0435 50\u043c2\",  \"full_text\": \"\u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u0430\u0440\u0435\u043d\u0434\u044b \u043d\u0435\u0436\u0438\u043b\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u211645 \u043e\u0442 01.03.2024. \u0410\u0440\u0435\u043d\u0434\u043e\u0434\u0430\u0442\u0435\u043b\u044c \u041e\u041e\u041e \u0420\u043e\u0433\u0430 \u0438 \u041a\u043e\u043f\u044b\u0442\u0430 \u0441\u0434\u0430\u0435\u0442 \u0432 \u0430\u0440\u0435\u043d\u0434\u0443 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u044c\u044e 50\u043c2...\"}"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "message": "\u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u0443\u0433 \u043e\u0442 15.06.2024. \u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u043e\u0431\u044f\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u043c\u043e\u043d\u0442 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u041c\u043e\u0441\u043a\u0432\u0430 \u0443\u043b. \u041b\u0435\u043d\u0438\u043d\u0430 \u0434.1..."
            },
            {
              "type": "AIMessagePromptTemplate",
              "message": "{\n  \"document_type\": \"contract\",\n  \"title\": \"15.06.2024 \u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u0443\u0433 \u043f\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0443 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b\",\n  \"full_text\": \"\u0414\u043e\u0433\u043e\u0432\u043e\u0440 \u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u0443\u0433 \u043e\u0442 15.06.2024. \u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u043e\u0431\u044f\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u043c\u043e\u043d\u0442 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u041c\u043e\u0441\u043a\u0432\u0430 \u0443\u043b. \u041b\u0435\u043d\u0438\u043d\u0430 \u0434.1...\"\n}\n"
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        1552,
        3552
      ],
      "id": "cf5ee05e-8faf-4d3a-aebe-79096a2bb7a3",
      "name": "Contract Processor"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check Msg Type1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Msg Type1": {
      "main": [
        [
          {
            "node": "Check Cmd Type1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get largestPhoto",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Sorry For Other",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Send Sorry For Shorts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Sorry For Live",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Sending a message about the start of work1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Sorry For Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Cmd Type1": {
      "main": [
        [
          {
            "node": "If User Does Not Exist1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Start Message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If User Does Not Exist1": {
      "main": [
        [
          {
            "node": "Insert row1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube Transcript1": {
      "main": [
        [
          {
            "node": "Format Transcript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Detect Dialogue vs Monologue3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Edit Dialog2": {
      "main": [
        [
          {
            "node": "Aggregate2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Dialog3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text Chunk Splitter3": {
      "main": [
        [
          {
            "node": "Edit Dialog2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser6": {
      "ai_outputParser": [
        [
          {
            "node": "Detect Dialogue vs Monologue3",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Sending a message about the start of work1": {
      "main": [
        [
          {
            "node": "YouTube Video Info1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcription1": {
      "main": [
        [
          {
            "node": "Send Transcription1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Transcription1": {
      "main": [
        [
          {
            "node": "Get Count1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete a chat message1": {
      "main": [
        [
          {
            "node": "Send an animated file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model11": {
      "ai_languageModel": [
        [
          {
            "node": "Edit Dialog2",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Structured Output Parser7": {
      "ai_outputParser": [
        [
          {
            "node": "Edit Dialog2",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model12": {
      "ai_languageModel": [
        [
          {
            "node": "Detect Dialogue vs Monologue3",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "DeepSeek Chat Model7": {
      "ai_languageModel": [
        [
          {
            "node": "Edit Dialog2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate2": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube Video Info1": {
      "main": [
        [
          {
            "node": "YouTube Transcript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model13": {
      "ai_languageModel": [
        [
          {
            "node": "Transcript Editor2",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "DeepSeek Chat Model8": {
      "ai_languageModel": [
        [
          {
            "node": "Transcript Editor2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "Text Chunk Splitter5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text Chunk Splitter4": {
      "main": [
        [
          {
            "node": "Transcript Editor2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Transcript1": {
      "main": [
        [
          {
            "node": "Text Chunk Splitter4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcript Editor2": {
      "main": [
        [
          {
            "node": "Aggregate3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Transcript Editor3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If Monologue1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Monologue1": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text Chunk Splitter3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text Chunk Splitter5": {
      "main": [
        [
          {
            "node": "Limit1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit1": {
      "main": [
        [
          {
            "node": "Detect Dialogue vs Monologue3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "Transcription1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Count1": {
      "main": [
        [
          {
            "node": "Delete a chat message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Count1": {
      "main": [
        [
          {
            "node": "Update Count1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser8": {
      "ai_outputParser": [
        [
          {
            "node": "Transcript Editor2",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Transcript Editor3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model9": {
      "ai_languageModel": [
        [
          {
            "node": "Transcript Editor3",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Transcript Editor3": {
      "main": [
        [
          {
            "node": "Aggregate3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser9": {
      "ai_outputParser": [
        [
          {
            "node": "Transcript Editor3",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model10": {
      "ai_languageModel": [
        [
          {
            "node": "Detect Dialogue vs Monologue2",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Detect Dialogue vs Monologue2": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser10": {
      "ai_outputParser": [
        [
          {
            "node": "Detect Dialogue vs Monologue2",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model14": {
      "ai_languageModel": [
        [
          {
            "node": "Detect Dialogue vs Monologue2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Edit Dialog3": {
      "main": [
        [
          {
            "node": "Aggregate2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model15": {
      "ai_languageModel": [
        [
          {
            "node": "Edit Dialog3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser11": {
      "ai_outputParser": [
        [
          {
            "node": "Edit Dialog3",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model11": {
      "ai_languageModel": [
        [
          {
            "node": "Edit Dialog3",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Detect Dialogue vs Monologue3": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Detect Dialogue vs Monologue2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Switch2": {
      "main": [
        [
          {
            "node": "Send an animated file3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Receipt Processor",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Invoice Processor",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Contract Processor",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code in JavaScript5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Receipt Processor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser12": {
      "ai_outputParser": [
        [
          {
            "node": "Classifier",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser13": {
      "ai_outputParser": [
        [
          {
            "node": "Receipt Processor",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Invoice Processor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser14": {
      "ai_outputParser": [
        [
          {
            "node": "Invoice Processor",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Contract Processor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript5": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser16": {
      "ai_outputParser": [
        [
          {
            "node": "Contract Processor",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser16",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser14",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model9": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser13",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model15": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser12",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get largestPhoto": {
      "main": [
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classifier": {
      "main": [
        [
          {
            "node": "Switch2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receipt Processor": {
      "main": [
        [
          {
            "node": "Code in JavaScript5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice Processor": {
      "main": [
        [
          {
            "node": "Code in JavaScript5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Contract Processor": {
      "main": [
        [
          {
            "node": "Code in JavaScript5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}