GPTとTTSを使ってWhatsAppでウェブサイトを音声要約に変換

上級

これはPersonal Productivity, AI Summarization分野の自動化ワークフローで、23個のノードを含みます。主にIf, Set, Code, Html, Mergeなどのノードを使用。 WhatsAppを通じてGPTとTTSを使用して、ウェブサイトを音声要約に変換します

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "42bde649da4575cc0d49afcf8affcdbece40e5e40061aa2c9b7a8b3639284dfe",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "3ac9465d-b69c-422e-a538-dbf9abbc7642",
      "name": "メッセージからURLを抽出",
      "type": "n8n-nodes-base.code",
      "position": [
        -576,
        240
      ],
      "parameters": {
        "jsCode": "// Extract URL from WhatsApp message\nconst item = $input.item.json;\n\n// Check if this is a message (not a status update)\nif (!item.messages || !Array.isArray(item.messages) || item.messages.length === 0) {\n  // This is a status update or empty, skip processing\n  return null;\n}\n\nconst message = item.messages[0];\nconst messageText = message.text?.body || '';\nconst from = message.from;\n\n// Simple URL extraction\nconst urlRegex = /(https?:\\/\\/[^\\s]+)/gi;\nconst urls = messageText.match(urlRegex);\n\nif (!urls || urls.length === 0) {\n  // No URL found, return error message\n  return {\n    error: true,\n    from: from,\n    message: \"⚠️ Please send a valid URL to summarize. Example: https://example.com\"\n  };\n}\n\nreturn {\n  URL: urls[0],\n  from: from,\n  original_message: messageText,\n  error: false\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "2da6a2a7-6bd3-4681-909a-d39fb1244d4b",
      "name": "有効なURLか確認",
      "type": "n8n-nodes-base.if",
      "position": [
        -432,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "has-url",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": false
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "660545af-20f0-467b-851b-d210c82ac48f",
      "name": "エラーメッセージを送信",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -208,
        416
      ],
      "webhookId": "9dfc84ae-12e0-4f63-8820-4ec2dc4db02f",
      "parameters": {
        "textBody": "={{ $json.message }}",
        "operation": "send",
        "phoneNumberId": "={{ $('WhatsApp Trigger').item.json.metadata.phone_number_id }}",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $json.from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "Lf4s3r55bG6RFGLw",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "a5a5d844-ff22-48df-8c3d-11e897aa1408",
      "name": "処理中メッセージを送信",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -208,
        224
      ],
      "webhookId": "8a404dac-179c-4e06-bd47-fbb214730f06",
      "parameters": {
        "textBody": "🔍 Fetching and analyzing webpage...\nThis may take 10-30 seconds.",
        "operation": "send",
        "phoneNumberId": "={{ $('WhatsApp Trigger').item.json.metadata.phone_number_id }}",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $json.from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "Lf4s3r55bG6RFGLw",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "68da6673-0e21-4a6f-b631-167748249777",
      "name": "ウェブページ要約を取得",
      "type": "n8n-nodes-base.executeWorkflow",
      "notes": "This calls your existing '[SUB] Get Webpage Summary' workflow",
      "position": [
        112,
        224
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "QglZjvjdZ16BisPN",
          "cachedResultUrl": "/workflow/QglZjvjdZ16BisPN",
          "cachedResultName": "[SUB] Get Webpage Summary"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b505c2b7-368b-4577-b7c8-7d1bdfba73a2",
      "name": "要約を音声に変換",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        288,
        224
      ],
      "parameters": {
        "input": "={{ $json.summary }}",
        "options": {
          "speed": 1,
          "response_format": "opus"
        },
        "resource": "audio"
      },
      "credentials": {
        "openAiApi": {
          "id": "mDGcGh1b3ALbNE4K",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8c75eb4b-c9b2-48a4-9e49-d71195110915",
      "name": "音声要約を送信",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        448,
        224
      ],
      "webhookId": "cb67c7fb-dd7e-423f-893c-f26266cde026",
      "parameters": {
        "mediaPath": "useMedian8n",
        "operation": "send",
        "messageType": "audio",
        "phoneNumberId": "={{ $('WhatsApp Trigger').item.json.metadata.phone_number_id }}",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('Extract URL from Message').item.json.from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "Lf4s3r55bG6RFGLw",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "d82c4465-e3d2-43ea-b61a-f93c39b2e5b1",
      "name": "付箋メモ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 380,
        "height": 1132,
        "content": "## 🎤 WhatsApp Voice Research Assistant\n\n**How it works:**\n1. User sends URL via WhatsApp\n2. Workflow fetches webpage\n3. AI summarizes content\n4. Text-to-speech conversion\n5. Audio summary sent back\n\n**Perfect for:**\n- Commuting (hands-free)\n- Multitasking\n- Visual impairments\n- Quick content review\n\n**Voice:** Natural AI voice (Alloy)\n**Language:** Auto-detects from content\n\n\nWhatsApp Requirements:\n\nYou will need a WhatsApp business account with OAuth:\n\nhttps://docs.n8n.io/integrations/builtin/credentials/whatsapp\n\nCreate a WhatsApp App and register a phone number (although a test number can be used if its just for one person and you don't plan to make this for public use)\n\nAnd create a System User to then generate a system user token (so that you don't have to manually generate a token every 4 hours.)\n\nhttps://business.facebook.com/latest/settings/system_users\n\nWhatsApp works well once its up and running. However it can be initially a chore as WhatsApp security wants you to verify the business when you make an app, when you register a phone, when you create a system user. So yes, at least 3 different times... possibly up to 5 times.\n\nAnother WhatsApp caveat: \nYou can't send an auto-generated message to a whatsapp users phone after 24 hours, unless that user has replied, special message template or the user has sent the app, a message first.\n\nFor example in the morning, you can send the app a quick \"Hi\" message and from then on, the app can work well. "
      },
      "typeVersion": 1
    },
    {
      "id": "35194f26-35c9-401e-88c4-b09102c0fafd",
      "name": "WhatsApp トリガー",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -720,
        240
      ],
      "webhookId": "1c4d0dd4-3820-4fc9-8926-b692c22509f1",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "Kng74VNxItdZDRjm",
          "name": "WhatsApp OAuth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3eef648b-506d-4a1e-8494-2892fab999b6",
      "name": "URLを取得",
      "type": "n8n-nodes-base.set",
      "position": [
        -48,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "32b5ebf5-67a4-4be9-b659-221c354a4957",
              "name": "URL",
              "type": "string",
              "value": "={{ $('Check if Valid URL').item.json.URL }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1e575c6d-c3a0-4426-a044-4d3b11711c5a",
      "name": "付箋メモ1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        608
      ],
      "parameters": {
        "width": 1265,
        "height": 495,
        "content": "## [SUB] Get Webpage Summary\n# Summarize website text with GPT"
      },
      "typeVersion": 1
    },
    {
      "id": "ef8b7ac7-09aa-49d2-98f0-491762d52370",
      "name": "OpenAI チャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        96,
        992
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "mDGcGh1b3ALbNE4K",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f8637017-8352-4034-bebc-a306bf90bab2",
      "name": "タイトルを抽出",
      "type": "n8n-nodes-base.html",
      "position": [
        -80,
        624
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "title",
              "cssSelector": "title"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d2bc9ef2-fdde-4549-b8e6-1f7611376d3c",
      "name": "要約チェーン",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        -160,
        784
      ],
      "parameters": {
        "options": {},
        "operationMode": "documentLoader"
      },
      "typeVersion": 2
    },
    {
      "id": "75a23c01-9746-48d8-b63f-17f5029e6841",
      "name": "クリーンアップ",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        768
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7b337b47-a1c6-470e-881f-0c038b4917e5",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "ca820521-4fff-4971-84b5-e6e2dbd8bb7a",
              "name": "summary",
              "type": "string",
              "value": "={{ $json.response.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "dc6be66b-f9a5-422a-9158-f3183d7c5f1b",
      "name": "マージ",
      "type": "n8n-nodes-base.merge",
      "position": [
        224,
        768
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "bc556f6b-1f69-46dc-bfee-0c3dc32e8644",
      "name": "デフォルトデータローダー",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -160,
        896
      ],
      "parameters": {
        "options": {},
        "jsonData": "={{ $('Extract Text Only').item.json.data }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "17be0ba5-0e78-4a59-8dfc-745ba92e8037",
      "name": "再帰的文字テキスト分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        96,
        864
      ],
      "parameters": {
        "options": {},
        "chunkSize": 6000
      },
      "typeVersion": 1
    },
    {
      "id": "e2efdfe7-203c-4eb6-a2e5-9027a3886173",
      "name": "テキストのみ抽出",
      "type": "n8n-nodes-base.html",
      "position": [
        -336,
        784
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "data",
              "cssSelector": "body",
              "skipSelectors": "img,nav"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3f6398b1-c16c-4f3e-b601-dd65efe98771",
      "name": "サブ実行",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -672,
        784
      ],
      "parameters": {
        "inputSource": "passthrough"
      },
      "typeVersion": 1.1
    },
    {
      "id": "32e45648-f0c0-4d1b-8dae-1a090fc468e3",
      "name": "サイトテキストを取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -544,
        784
      ],
      "parameters": {
        "url": "=https://r.jina.ai/{{ $json.URL }}",
        "options": {
          "redirect": {
            "redirect": {
              "maxRedirects": 5
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
            },
            {
              "name": "Accept",
              "value": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0e76e32f-270e-4714-839b-b490d0bbdaf7",
      "name": "アップロード&パス処理1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -16
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 224,
        "content": "## WhatsApp Trigger -> Extract URL -> Check if Valid\n\n1. **WhatsApp Trigger**: Reads URl\n2. **Extract URL node**: Gets URL from WhatsApp\n3. **Check if Valid**: Checks to see if we have valid URL"
      },
      "typeVersion": 1
    },
    {
      "id": "18c324d6-0a56-4903-a0ab-8641eec897eb",
      "name": "共有リンク管理1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -16
      ],
      "parameters": {
        "color": 2,
        "width": 768,
        "height": 224,
        "content": "## Summarize webpage and answer in audio message back to WhatsApp\n\n1. **WhatsApp Notification**: Notifies user of pending summery \n2. **Sets URL for wub workflow**\n3. **Sub Workflow - Gets Webpage Summary**\n5. **Generate Summary Audio** \n4. **WhatsApp Audio Message**: Generates audio message response with summary back to user"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "dc6be66b-f9a5-422a-9158-f3183d7c5f1b": {
      "main": [
        [
          {
            "node": "75a23c01-9746-48d8-b63f-17f5029e6841",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3eef648b-506d-4a1e-8494-2892fab999b6": {
      "main": [
        [
          {
            "node": "68da6673-0e21-4a6f-b631-167748249777",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3f6398b1-c16c-4f3e-b601-dd65efe98771": {
      "main": [
        [
          {
            "node": "32e45648-f0c0-4d1b-8dae-1a090fc468e3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f8637017-8352-4034-bebc-a306bf90bab2": {
      "main": [
        [
          {
            "node": "dc6be66b-f9a5-422a-9158-f3183d7c5f1b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "32e45648-f0c0-4d1b-8dae-1a090fc468e3": {
      "main": [
        [
          {
            "node": "f8637017-8352-4034-bebc-a306bf90bab2",
            "type": "main",
            "index": 0
          },
          {
            "node": "e2efdfe7-203c-4eb6-a2e5-9027a3886173",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "35194f26-35c9-401e-88c4-b09102c0fafd": {
      "main": [
        [
          {
            "node": "3ac9465d-b69c-422e-a538-dbf9abbc7642",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e2efdfe7-203c-4eb6-a2e5-9027a3886173": {
      "main": [
        [
          {
            "node": "d2bc9ef2-fdde-4549-b8e6-1f7611376d3c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ef8b7ac7-09aa-49d2-98f0-491762d52370": {
      "ai_languageModel": [
        [
          {
            "node": "d2bc9ef2-fdde-4549-b8e6-1f7611376d3c",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2da6a2a7-6bd3-4681-909a-d39fb1244d4b": {
      "main": [
        [
          {
            "node": "a5a5d844-ff22-48df-8c3d-11e897aa1408",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "660545af-20f0-467b-851b-d210c82ac48f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bc556f6b-1f69-46dc-bfee-0c3dc32e8644": {
      "ai_document": [
        [
          {
            "node": "d2bc9ef2-fdde-4549-b8e6-1f7611376d3c",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "68da6673-0e21-4a6f-b631-167748249777": {
      "main": [
        [
          {
            "node": "b505c2b7-368b-4577-b7c8-7d1bdfba73a2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d2bc9ef2-fdde-4549-b8e6-1f7611376d3c": {
      "main": [
        [
          {
            "node": "dc6be66b-f9a5-422a-9158-f3183d7c5f1b",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "a5a5d844-ff22-48df-8c3d-11e897aa1408": {
      "main": [
        [
          {
            "node": "3eef648b-506d-4a1e-8494-2892fab999b6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b505c2b7-368b-4577-b7c8-7d1bdfba73a2": {
      "main": [
        [
          {
            "node": "8c75eb4b-c9b2-48a4-9e49-d71195110915",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3ac9465d-b69c-422e-a538-dbf9abbc7642": {
      "main": [
        [
          {
            "node": "2da6a2a7-6bd3-4681-909a-d39fb1244d4b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "17be0ba5-0e78-4a59-8dfc-745ba92e8037": {
      "ai_textSplitter": [
        [
          {
            "node": "bc556f6b-1f69-46dc-bfee-0c3dc32e8644",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - 個人の生産性, AI要約

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数23
カテゴリー2
ノードタイプ16
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

作成者

I write code to save you headaches. I post workflows, that I had a hard time with or find was really needed. If you pay for one of my workflows, congratulations... it probably took me 10x the $$ amount in my personal time, figuring the darn thing out.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34