{
  "updatedAt": "2025-02-07T10:21:03.000Z",
  "createdAt": "2025-02-07T10:20:53.225Z",
  "id": "EkEMabL1x89Xy52g",
  "name": "Trợ lý AI Tóm tắt video youtube",
  "description": null,
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.1,
      "position": [
        200,
        200
      ],
      "id": "52e08892-cf01-418d-809f-6947cd5fa832",
      "name": "Telegram Trigger",
      "webhookId": "d1aa8c78-fa17-4efe-aef1-d627b36dc290"
    },
    {
      "parameters": {
        "content": "Nhận link từ Telegram > Lấy tin nhắn > nếu là link youtube > thì xử lý > Lấy ID Video > Lấy phụ đề > Đưa vào AI > gửi lại Telegram",
        "height": 120
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        180,
        0
      ],
      "id": "59144114-2d56-47da-98aa-fe82ebcbe3b4",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "dba5d9f8-f085-45d8-959a-338ee0b6366f",
              "name": "message",
              "value": "={{ $json.message.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        440,
        200
      ],
      "id": "cb9fb55d-b3b2-44c3-ad7b-94be7e10b797",
      "name": "layMessage"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "c7cc1adb-995e-466b-a684-567a9577c1e0",
              "leftValue": "={{ $json.message }}",
              "rightValue": "youtube.com",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        660,
        200
      ],
      "id": "5b5c5009-0dd2-4a02-b1dc-e9ceb668e1e1",
      "name": "nếu là link youtube"
    },
    {
      "parameters": {
        "videoId": "={{ $json.videoID }}"
      },
      "id": "bbd4212d-8b57-487c-af10-9bdf71c37ac9",
      "name": "YouTube Transcript",
      "type": "n8n-nodes-youtube-transcription.youtubeTranscripter",
      "position": [
        1220,
        -40
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e8b2932d-4e40-4b8e-932b-64eb0ace7219",
              "name": "videoID",
              "value": "={{ $('nếu là link youtube').item.json.message.split(\"=\").last() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1020,
        -40
      ],
      "id": "3c703bca-458e-477b-aac9-022d6d56c728",
      "name": "videoId"
    },
    {
      "parameters": {
        "fieldToSplitOut": "transcript",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1400,
        -40
      ],
      "id": "ca60dfc9-6c5d-47a0-ada2-b876dbe861e1",
      "name": "Split Out"
    },
    {
      "parameters": {
        "fieldsToSummarize": {
          "values": [
            {
              "aggregation": "concatenate",
              "field": "text",
              "separateBy": " "
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.summarize",
      "typeVersion": 1,
      "position": [
        980,
        320
      ],
      "id": "809685f3-4763-43d3-a7e0-b9c1b2acbb41",
      "name": "nối chuổi"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        1180,
        520
      ],
      "id": "68e5258e-4d2d-4938-853a-cfdd752d625a",
      "name": "OpenAI Chat Model"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=hãy là một nhà TÓM TẮC video youtube CHUYÊN NGHIỆP VÀ TÓM TẮC PHỤ ĐỀ VIDEO SAU sau bằng tiếng việt.\n\nYÊU CẦU:\n- ngắn gọn, dễ hiểu\n\nnội dung văn bản là:\n {{ $json.concatenated_text }}"
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        1160,
        320
      ],
      "id": "dd4ba803-9164-460e-b2bf-8c724576b66f",
      "name": "Tóm tắc phụ đề"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "text": "=ĐÂY LÀ BẢN TÓM TẮC:\n{{ $json.text }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1520,
        320
      ],
      "id": "fb569835-64c0-4273-bb24-8363f6758014",
      "name": "GỬI KẾT QUẢ"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "text": "Sếp chờ em chút ...",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        800,
        -40
      ],
      "id": "ca9d3528-48c6-4fc3-a793-9e3939ba06f1",
      "name": "chờ em chút"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "layMessage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "layMessage": {
      "main": [
        [
          {
            "node": "nếu là link youtube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nếu là link youtube": {
      "main": [
        [
          {
            "node": "chờ em chút",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "videoId": {
      "main": [
        [
          {
            "node": "YouTube Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube Transcript": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "nối chuổi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nối chuổi": {
      "main": [
        [
          {
            "node": "Tóm tắc phụ đề",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Tóm tắc phụ đề",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Tóm tắc phụ đề": {
      "main": [
        [
          {
            "node": "GỬI KẾT QUẢ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "chờ em chút": {
      "main": [
        [
          {
            "node": "videoId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": null,
  "pinData": {
    "Telegram Trigger": [
      {
        "json": {
          "update_id": 637639862,
          "message": {
            "message_id": 11,
            "from": {
              "id": 5444173779,
              "is_bot": false,
              "first_name": "Bình",
              "last_name": "Đặng",
              "username": "dnbinh1990",
              "language_code": "en"
            },
            "chat": {
              "id": 5444173779,
              "first_name": "Bình",
              "last_name": "Đặng",
              "username": "dnbinh1990",
              "type": "private"
            },
            "date": 1738921028,
            "text": "https://www.youtube.com/watch?v=roSKVNN1aDQ",
            "entities": [
              {
                "offset": 0,
                "length": 43,
                "type": "url"
              }
            ],
            "link_preview_options": {
              "url": "https://www.youtube.com/watch?v=roSKVNN1aDQ"
            }
          }
        }
      }
    ]
  },
  "versionId": "0a78d2ad-39bc-4b8e-b813-367746cf457c",
  "activeVersionId": null,
  "versionCounter": 1,
  "triggerCount": 0,
  "shared": [
    {
      "updatedAt": "2025-02-07T10:20:53.238Z",
      "createdAt": "2025-02-07T10:20:53.238Z",
      "role": "workflow:owner",
      "workflowId": "EkEMabL1x89Xy52g",
      "projectId": "Nlp7kXCVcAfb0cmG",
      "project": {
        "updatedAt": "2024-07-25T03:06:26.102Z",
        "createdAt": "2024-07-25T03:06:26.102Z",
        "id": "Nlp7kXCVcAfb0cmG",
        "name": "Bình Đặng <dangngocbinh.dnb@gmail.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "92f1ca82-c19e-4a7d-8458-93b65f67f4c7"
      }
    }
  ],
  "tags": [
    {
      "updatedAt": "2024-10-04T03:03:40.628Z",
      "createdAt": "2024-10-04T03:03:40.628Z",
      "id": "MW10UcI4NI01thiG",
      "name": "share"
    }
  ],
  "activeVersion": null
}