Telegram自動複製ヘッドライナー
上級
これはSocial Media, Multimodal AI分野の自動化ワークフローで、19個のノードを含みます。主にIf, Set, Code, Html, Telegramなどのノードを使用。 GPT-4o-miniを基にしたTelegramチャンネルコンテンツの自動コピーと翻译
前提条件
- •Telegram Bot Token
- •ターゲットAPIの認証情報が必要な場合あり
- •OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "VjbCxJ8Hgo44WZdf",
"meta": {
"instanceId": "f5aa635d637faa7cf397adde51f1a02fdf8ac6454c1c6457738ffd11609a900c"
},
"name": "TelegramAutoCopier",
"tags": [],
"nodes": [
{
"id": "aeb0620d-095c-4238-8dd0-0232c4905e19",
"name": "デイリースケジュール",
"type": "n8n-nodes-base.scheduleTrigger",
"notes": "Triggers the workflow daily at 9 AM. Adjust the time according to your needs.",
"position": [
-1220,
-60
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.2
},
{
"id": "3ea234cc-4f02-4216-8013-554eb1fba0fd",
"name": "チャンネルページ取得",
"type": "n8n-nodes-base.httpRequest",
"notes": "Fetches the HTML content of the source Telegram channel",
"position": [
-780,
-60
],
"parameters": {
"url": "=https://t.me/s/{{ $('Set Telegram Channels').item.json.sourceChannel }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
}
]
}
},
"notesInFlow": true,
"typeVersion": 4.2
},
{
"id": "eb0d33be-2e66-43cc-90fa-d1b9878615d9",
"name": "投稿内容抽出",
"type": "n8n-nodes-base.html",
"notes": "Extracts text, images, and videos from the latest Telegram post",
"position": [
-560,
-60
],
"parameters": {
"options": {
"trimValues": false,
"cleanUpText": false
},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "post",
"cssSelector": "div.tgme_widget_message_wrap:last-of-type div.js-message_text"
},
{
"key": "postId",
"cssSelector": "div.tgme_widget_message_wrap:last-of-type div.tgme_widget_message_info span.tgme_widget_message_meta"
},
{
"key": "video",
"attribute": "src",
"cssSelector": "div.tgme_widget_message_wrap:last-of-type div.tgme_widget_message_bubble a div.tgme_widget_message_video_wrap > video",
"returnValue": "attribute"
},
{
"key": "photo",
"attribute": "style",
"cssSelector": "div.tgme_widget_message_wrap:last-of-type div.tgme_widget_message_bubble div.media_supported_cont > a.tgme_widget_message_photo_wrap",
"returnValue": "attribute"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "715418a9-9598-460a-817e-e2b681f336c4",
"name": "投稿内容整理",
"type": "n8n-nodes-base.code",
"notes": "Removes original channel signature and cleans up the text",
"position": [
-340,
-60
],
"parameters": {
"jsCode": "// Clean up the post content by removing original channel signature\nif ($input.first().json.post) {\n let cleanPost = $input.first().json.post \n .replaceAll($('Set Telegram Channels').first().json.channelSignature, '')\n .trim();\n \n $input.first().json.post = cleanPost;\n}\n\nreturn $input.all();"
},
"notesInFlow": true,
"typeVersion": 2
},
{
"id": "31508b88-fd99-4b7c-abb7-52084caf9373",
"name": "テキスト翻訳",
"type": "@n8n/n8n-nodes-langchain.openAi",
"notes": "Uses OpenAI to translate the post content to the target language",
"position": [
-120,
-60
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "GPT-4O-MINI"
},
"options": {},
"messages": {
"values": [
{
"content": "=Translate the following text to {{ $('Set Telegram Channels').item.json.targetLanguage }} in a friendly, natural style.\nReturn only the translated text without any additional commentary or formatting.\n\nText to translate:\n{{ $json.post }}"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "hjq9L6ppDLFMNOcE",
"name": "OpenAi account"
}
},
"notesInFlow": true,
"typeVersion": 1.8
},
{
"id": "e0017199-a33a-4866-9fa8-3be34fbf20e8",
"name": "メディアURL処理",
"type": "n8n-nodes-base.code",
"notes": "Extracts clean URLs from CSS style attributes for images",
"position": [
256,
-60
],
"parameters": {
"jsCode": "// Process photo URL from CSS style attribute\nif ($('Extract Post Content').first().json.photo) {\n const styleAttr = $('Extract Post Content').first().json.photo;\n const urlMatch = styleAttr.match(/background-image:url\\('([^']+)'\\)/);\n \n if (urlMatch && urlMatch[1]) {\n $input.first().json.photo = urlMatch[1];\n } else {\n // Fallback: try to extract from quotes\n const arr = styleAttr.split(\"'\");\n if (arr.length >= 2) {\n $input.first().json.photo = arr[arr.length - 2];\n }\n }\n}\n\nreturn $input.all();"
},
"notesInFlow": true,
"typeVersion": 2
},
{
"id": "8f05161f-776b-4684-9acc-d2cc426ad78c",
"name": "写真あり?",
"type": "n8n-nodes-base.if",
"notes": "Checks if the post contains a photo",
"position": [
476,
-260
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "202a35e0-040c-47d2-9aaa-2f7d295ac2dd",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.photo }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "70c14a77-b297-4ac2-9ec4-a9d7124b7ce4",
"name": "動画あり?",
"type": "n8n-nodes-base.if",
"notes": "Checks if the post contains a video",
"position": [
476,
140
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "95dcac89-39c4-4a0a-8c1c-e1c560be755f",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $('Extract Post Content').item.json.video }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "11abbf2e-043b-4129-b15b-f625bb12802a",
"name": "テキストのみ?",
"type": "n8n-nodes-base.if",
"position": [
476,
-60
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7d0504ca-12c6-4496-8879-3f7d295ac2dd",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $('Extract Post Content').item.json.video }}",
"rightValue": ""
},
{
"id": "3cca8e10-546a-4b42-ac6f-0cc91773949c",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $('Extract Post Content').item.json.photo }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "926e4cca-4028-43bf-98ae-4f1e6f38fc08",
"name": "写真ダウンロード",
"type": "n8n-nodes-base.httpRequest",
"notes": "Downloads the photo from Telegram servers",
"position": [
696,
-260
],
"parameters": {
"url": "={{ $json.photo }}",
"options": {
"timeout": 30000
}
},
"notesInFlow": true,
"typeVersion": 4.2
},
{
"id": "a2349dfe-45f9-4688-a915-0af0587a0e48",
"name": "動画ダウンロード",
"type": "n8n-nodes-base.httpRequest",
"notes": "Downloads the video from Telegram servers",
"position": [
696,
140
],
"parameters": {
"url": "={{ $('Extract Post Content').item.json.video }}",
"options": {
"timeout": 60000
}
},
"notesInFlow": true,
"typeVersion": 4.2
},
{
"id": "28a45272-c1a7-44cc-b396-aa40485baf37",
"name": "写真をチャンネル送信",
"type": "n8n-nodes-base.telegram",
"notes": "Sends the translated post with photo to target channel",
"position": [
916,
-260
],
"webhookId": "d72b2e9d-c37c-4bbe-985b-8b1699bce9b3",
"parameters": {
"chatId": "={{ $('Set Telegram Channels').item.json.targetChannel }}",
"operation": "sendPhoto",
"binaryData": true,
"additionalFields": {
"caption": "={{ $json.message.content }}\\n{{ $('Set Telegram Channels').item.json.channelSignature }}"
}
},
"credentials": {
"telegramApi": {
"id": "XfNUxlQY3eiC3bFY",
"name": "TelegramAIWriterBot"
}
},
"typeVersion": 1.2
},
{
"id": "cd3f5b26-0250-4a12-9dec-2b82891b1daf",
"name": "動画をチャンネル送信",
"type": "n8n-nodes-base.telegram",
"notes": "Sends the translated post with video to target channel",
"position": [
916,
140
],
"webhookId": "c532eafe-875d-4ac2-8d77-52f5dd84c3c5",
"parameters": {
"chatId": "={{ $('Set Telegram Channels').item.json.targetChannel }}",
"operation": "sendVideo",
"binaryData": true,
"additionalFields": {
"caption": "={{ $json.message.content }}\\n{{ $('Set Telegram Channels').item.json.channelSignature }}"
}
},
"credentials": {
"telegramApi": {
"id": "XCmO6hPfws6PgHMt",
"name": "TelegramBotCryptoApp"
}
},
"typeVersion": 1.2
},
{
"id": "2737cc48-5c12-442a-8f6f-15a4e77f91c4",
"name": "テキストをチャンネル送信",
"type": "n8n-nodes-base.telegram",
"notes": "Sends text-only translated posts to target channel",
"position": [
696,
-60
],
"webhookId": "c58b24f7-3799-4021-be07-fe74705ef7c3",
"parameters": {
"text": "={{ $json.message.content }}\\n{{ $('Set Telegram Channels').item.json.channelSignature }}",
"chatId": "={{ $('Set Telegram Channels').item.json.targetChannel }}",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "9cc2d449-c59a-460f-bb50-236cd914783c",
"name": "📖 セットアップ手順",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1400,
-760
],
"parameters": {
"width": 500,
"height": 620,
"content": "## Telegram Channel Content Copier & Translator\n**Automatically copies and translates content from one Telegram channel to another**\n\n### What this workflow does:\n- 📅 Runs daily at a scheduled time\n- 🔍 Fetches the latest post from a source Telegram channel\n- 🌐 Translates the content using OpenAI\n- 📤 Republishes to your target channel\n- 🖼️ Supports text, images, and videos\n\n### Setup Instructions:\n1. **Configure channels** in the 'Set Source Channel' node\n2. **Set up Telegram Bot** credentials\n3. **Add OpenAI API** credentials\n4. **Adjust schedule** as needed\n\n### Required Credentials:\n- Telegram Bot API\n- OpenAI API\n\n[Documentation & Support](https://n8n.io/integrations/telegram/)"
},
"typeVersion": 1
},
{
"id": "5900c319-3a6f-4057-ab5c-209ceb0d9d61",
"name": "Telegram チャンネル設定",
"type": "n8n-nodes-base.set",
"notes": "Configure your source channel, target channel, and other settings here",
"position": [
-1000,
-60
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "source_channel",
"name": "sourceChannel",
"type": "string",
"value": "channel_username"
},
{
"id": "target_channel",
"name": "targetChannel",
"type": "string",
"value": "@channel_username"
},
{
"id": "target_language",
"name": "targetLanguage",
"type": "string",
"value": "Persian"
},
{
"id": "channel_signature",
"name": "channelSignature",
"type": "string",
"value": "@channel_username"
}
]
}
},
"notesInFlow": true,
"typeVersion": 3.4
},
{
"id": "7902b67b-24f5-4d7b-b54e-85b22e97c073",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1020,
-200
],
"parameters": {
"color": 7,
"width": 800,
"height": 220,
"content": "## 1. Get the html content of the source Telegram channel\nIn this part of the workflow we fetch the html content of source channel and then extract text, images, and videos from the latest Telegram post.\nRemoves original channel signatures and cleans up the text"
},
"typeVersion": 1
},
{
"id": "5c68259a-a22d-4c35-8bbb-7853233e3cb8",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-160,
-180
],
"parameters": {
"color": 7,
"width": 360,
"content": "## 2. Use AI for translation\n\nUses OpenAI to translate the post content to the target language"
},
"typeVersion": 1
},
{
"id": "56690988-fe75-43b6-9919-2e7d52a66bc6",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
226,
-420
],
"parameters": {
"color": 7,
"width": 600,
"height": 720,
"content": "## 3. Extract Media URLs and Identify Media Type\nTelegram uses different methods for handling image and video content. In this step, we identify the type of media included in the post.\n\nIf the post contains an image or video, the corresponding media file is downloaded."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "6d57d267-bda4-417a-b3f5-3be54a01e92d",
"connections": {
"8f05161f-776b-4684-9acc-d2cc426ad78c": {
"main": [
[
{
"node": "926e4cca-4028-43bf-98ae-4f1e6f38fc08",
"type": "main",
"index": 0
}
]
]
},
"70c14a77-b297-4ac2-9ec4-a9d7124b7ce4": {
"main": [
[
{
"node": "a2349dfe-45f9-4688-a915-0af0587a0e48",
"type": "main",
"index": 0
}
]
]
},
"11abbf2e-043b-4129-b15b-f625bb12802a": {
"main": [
[
{
"node": "2737cc48-5c12-442a-8f6f-15a4e77f91c4",
"type": "main",
"index": 0
}
]
]
},
"aeb0620d-095c-4238-8dd0-0232c4905e19": {
"main": [
[
{
"node": "5900c319-3a6f-4057-ab5c-209ceb0d9d61",
"type": "main",
"index": 0
}
]
]
},
"926e4cca-4028-43bf-98ae-4f1e6f38fc08": {
"main": [
[
{
"node": "28a45272-c1a7-44cc-b396-aa40485baf37",
"type": "main",
"index": 0
}
]
]
},
"a2349dfe-45f9-4688-a915-0af0587a0e48": {
"main": [
[
{
"node": "cd3f5b26-0250-4a12-9dec-2b82891b1daf",
"type": "main",
"index": 0
}
]
]
},
"31508b88-fd99-4b7c-abb7-52084caf9373": {
"main": [
[
{
"node": "e0017199-a33a-4866-9fa8-3be34fbf20e8",
"type": "main",
"index": 0
}
]
]
},
"715418a9-9598-460a-817e-e2b681f336c4": {
"main": [
[
{
"node": "31508b88-fd99-4b7c-abb7-52084caf9373",
"type": "main",
"index": 0
}
]
]
},
"3ea234cc-4f02-4216-8013-554eb1fba0fd": {
"main": [
[
{
"node": "eb0d33be-2e66-43cc-90fa-d1b9878615d9",
"type": "main",
"index": 0
}
]
]
},
"e0017199-a33a-4866-9fa8-3be34fbf20e8": {
"main": [
[
{
"node": "8f05161f-776b-4684-9acc-d2cc426ad78c",
"type": "main",
"index": 0
},
{
"node": "70c14a77-b297-4ac2-9ec4-a9d7124b7ce4",
"type": "main",
"index": 0
},
{
"node": "11abbf2e-043b-4129-b15b-f625bb12802a",
"type": "main",
"index": 0
}
]
]
},
"eb0d33be-2e66-43cc-90fa-d1b9878615d9": {
"main": [
[
{
"node": "715418a9-9598-460a-817e-e2b681f336c4",
"type": "main",
"index": 0
}
]
]
},
"5900c319-3a6f-4057-ab5c-209ceb0d9d61": {
"main": [
[
{
"node": "3ea234cc-4f02-4216-8013-554eb1fba0fd",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - ソーシャルメディア, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
WooCommerce_テンプレートに自動投稿
Telegram チャンネル投稿を WooCommerce 製品に自動変換する
If
Set
Code
+
If
Set
Code
26 ノードShohani
コンテンツ作成
AI駆動型動画制作&Instagram/TikTok/YouTubeへの自動アップロード
クラウドドライブからAI駆動の動画作成およびInstagram、TikTok、YouTubeへのアップロード
If
Set
Code
+
If
Set
Code
53 ノードDevCode Journey
コンテンツ作成
RSSをFacebookおよびInstagramに公開
AIによる要約と画像生成を使ったRSSからソーシャルメディアへの自動公開
If
Set
Code
+
If
Set
Code
34 ノードKarol
コンテンツ作成
再生リスト詳細設定ボットコピー
Suno、GPT-4、Runway、Creatomate を使って AI 生成の YouTube ミュージックプレイリストを作成
If
Set
Code
+
If
Set
Code
203 ノードJoseph
コンテンツ作成
Telegramフォーラムペルス:コミュニティモニタリングのためのGeminiとGroq AIモデル
Telegramフォーラムペルス:GeminiとGroq AIモデルを使ったコミュニティ監視
If
Set
Code
+
If
Set
Code
59 ノードNguyen Thieu Toan
その他
Gemini、Tavily および人間の審査を使用して SEO 最適化された WordPress ブログを生成
Gemini、Tavily、そして人間の審査を使ってSEO最適化されたWordPressブログを生成する
If
Set
Code
+
If
Set
Code
38 ノードAryan Shinde
コンテンツ作成