流程
输入文章
AI 自动生成 PPT 结构
自动生成分镜描述
自动推送到 Gamma / SlidesAI / 飞书文档
特点与能力:
输入:文章 / 长文(Notion / 粘贴 / Google Sheet)
AI:自动拆分成幻灯片大纲(标题 + 3 要点/页)
可选:为每页生成配图 Prompt 并调用图像 API 批量生成图片(OpenAI Image / Midjourney 占位)
自动调用 PPT 生成服务(占位 API;你也可以替换为 SlidesAI、Google Slides API、自建 PPT 服务)把每页合成成 PPT 文件(含图片)
上传到 Google Drive(或 OSS)并回写 Notion(归档)
错误重试、并发控制与导出链接回应
提醒:导入后请替换所有 YOUR_... / 占位 API URL / 凭证(OpenAI Key、Google Drive、Notion 等)。
下面是 可直接复制 → n8n → Import from Clipboard 的完整 JSON。
{ "name": "Article_to_PPT_Full", "nodes": [ { "id": "Trigger", "name": "Manual Trigger", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [200, 300] }, { "id": "SetArticle", "name": "Set Article (Input)", "type": "n8n-nodes-base.set", "typeVersion": 1, "position": [450, 300], "parameters": { "values": { "string": [ { "name": "title", "value": "如何用 n8n 打造你的内容自动化工厂" }, { "name": "article", "value": "把你要转换的长文贴到这里,示例:本文将介绍如何用 n8n 结合 OpenAI、Notion、自动生成内容、批量分发并最终生成 PPT,用于内训与讲座。步骤包括抓取主题、生成提纲、拆分幻灯片、配图提示、生成 PPT 并上传。" }, { "name": "slides_count", "value": "10" }, { "name": "image_per_slide", "value": "true" } ] } } }, { "id": "GenerateSlides", "name": "Generate Slides Outline (OpenAI)", "type": "n8n-nodes-base.openAi", "typeVersion": 3, "position": [750, 300], "credentials": { "openAiApi": { "id": "OPENAI_CRED_ID" } }, "parameters": { "operation": "chat", "model": "gpt-4o-mini", "messages": [ { "role": "system", "content": "你是幻灯片与演示文稿专家。把给定文章拆分为 N 页幻灯片的大纲。每页输出:{page_number, title, three_bullet_points, speaker_notes, image_prompt}。输出严格为 JSON 数组。" }, { "role": "user", "content": "文章标题:{{$json.title}}\n文章正文:{{$json.article}}\n目标页数:{{$json.slides_count}}\n要求:每页保留 1 行标题、3 条要点(简短)、一段 40-80 字的演讲稿备注(speaker_notes)、并为每页生成一条用于 AI 图像生成的 prompt(image_prompt),尽量做到风格统一、公司 VI 友好。输出 JSON 数组。" } ], "additionalFields": { "temperature": 0.2, "max_tokens": 2000 } } }, { "id": "ParseSlides", "name": "Parse Slides JSON", "type": "n8n-nodes-base.function", "typeVersion": 1, "position": [1050, 300], "parameters": { "functionCode": "const raw = $json.data?.[0]?.message?.content || $json[\"choices\"]?.[0]?.message?.content || $json;\nlet arr = [];\ntry{\n arr = JSON.parse(raw);\n} catch(e) {\n // try to extract JSON block\n const m = raw.match(/\\[\\s*\\{[\\s\\S]*\\}\\s*\\]/);\n if(m) arr = JSON.parse(m[0]);\n}\n// normalize fields\narr = (arr || []).map((p, i) => ({ page_number: p.page_number || i+1, title: p.title || (`Slide ${i+1}`), bullets: p.three_bullet_points || p.bullets || [], speaker_notes: p.speaker_notes || '', image_prompt: p.image_prompt || (p.title || '').slice(0,60) }));\nreturn arr.map(a => ({ json: a }));" } }, { "id": "SplitSlides", "name": "Split Into Slides (itemize)", "type": "n8n-nodes-base.itemLists", "typeVersion": 1, "position": [1300, 300], "parameters": { "operation": "split", "property": "" } }, { "id": "GenerateImage", "name": "Generate Image per Slide (OpenAI Image)", "type": "n8n-nodes-base.openAi", "typeVersion": 3, "position": [1600, 180], "credentials": { "openAiApi": { "id": "OPENAI_CRED_ID" } }, "parameters": { "operation": "imageGenerate", "modelId": "gpt-image-1", "prompt": "={{ $json.image_prompt }}", "size": "1024x1024", "responseFormat": "b64_json" } }, { "id": "SaveImageLocal", "name": "Save Image Binary", "type": "n8n-nodes-base.moveBinaryData", "typeVersion": 1, "position": [1850, 180], "parameters": { "sourceKey": "data", "destinationKey": "slideImage", "dataIsBase64": true } }, { "id": "UploadImageOSS", "name": "Upload Image to OSS (placeholder)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 1, "position": [2100, 180], "parameters": { "method": "POST", "url": "https://api.your-oss.com/upload", "jsonParameters": true, "bodyParametersJson": "={ \"path\": \"ppt_images/{{ $json.page_number }}.png\", \"file_base64\": \"{{$binary.slideImage.data}}\" }" } }, { "id": "CollectImages", "name": "Collect Images (aggregate)", "type": "n8n-nodes-base.merge", "typeVersion": 1, "position": [2350, 220], "parameters": { "mode": "aggregate" } }, { "id": "CreatePPT", "name": "Create PPT (External API)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 1, "position": [2600, 300], "parameters": { "method": "POST", "url": "https://api.example.com/generate-ppt", "jsonParameters": true, "bodyParametersJson": "={\n\"title\": \"{{$items(\"SetArticle\")[0].json.title}}\",\n\"slides\": {{$json}},\n\"author\": \"n8n-automator\"\n}" } }, { "id": "UploadDrive", "name": "Upload PPT to Google Drive (placeholder)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 1, "position": [2850, 300], "parameters": { "method": "POST", "url": "https://api.your-storage.com/upload", "jsonParameters": true, "bodyParametersJson": "={ \"file_base64\": \"{{$binary[\"file\"]?.data || ''}}\", \"filename\":\"{{$items(\"SetArticle\")[0].json.title}}.pptx\" }" } }, { "id": "NotionArchive", "name": "Archive to Notion", "type": "n8n-nodes-base.notion", "typeVersion": 2, "position": [3100, 300], "credentials": { "notionApi": { "id": "NOTION_CRED_ID" } }, "parameters": { "operation": "create", "resource": "page", "databaseId": "YOUR_NOTION_PPT_DB_ID", "propertiesUi": { "propertyValues": [ { "name": "Title", "type": "title", "title": [ { "text": { "content": "={{ $items(\"SetArticle\")[0].json.title }}" } } ] }, { "name": "PPT Link", "type": "url", "url": "={{ $json.url || $json.file_url || '' }}" }, { "name": "Slides", "type": "rich_text", "rich_text": [ { "text": { "content": "={{ JSON.stringify($json.slides || $json, null, 2) }}" } } ] } ] } } }, { "id": "Respond", "name": "Respond with Link", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1, "position": [3400, 300], "parameters": { "responseCode": 200, "responseBody": "={ \"message\": \"PPT 已生成\", \"link\": $json.url || $json.file_url || '请在 Notion 查看' }" } } ], "connections": { "Manual Trigger": { "main": [ [ { "node": "Set Article (Input)", "type": "main", "index": 0 } ] ] }, "Set Article (Input)": { "main": [ [ { "node": "Generate Slides Outline (OpenAI)", "type": "main", "index": 0 } ] ] }, "Generate Slides Outline (OpenAI)": { "main": [ [ { "node": "Parse Slides JSON", "type": "main", "index": 0 } ] ] }, "Parse Slides JSON": { "main": [ [ { "node": "Split Into Slides (itemize)", "type": "main", "index": 0 } ] ] }, "Split Into Slides (itemize)": { "main": [ [ { "node": "Generate Image per Slide (OpenAI Image)", "type": "main", "index": 0 } ] ] }, "Generate Image per Slide (OpenAI Image)": { "main": [ [ { "node": "Save Image Binary", "type": "main", "index": 0 } ] ] }, "Save Image Binary": { "main": [ [ { "node": "Upload Image to OSS (placeholder)", "type": "main", "index": 0 } ] ] }, "Upload Image to OSS (placeholder)": { "main": [ [ { "node": "Collect Images (aggregate)", "type": "main", "index": 0 } ] ] }, "Collect Images (aggregate)": { "main": [ [ { "node": "Create PPT (External API)", "type": "main", "index": 0 } ] ] }, "Create PPT (External API)": { "main": [ [ { "node": "Upload PPT to Google Drive (placeholder)", "type": "main", "index": 0 }, { "node": "Archive to Notion", "type": "main", "index": 0 } ] ] }, "Upload PPT to Google Drive (placeholder)": { "main": [ [ { "node": "Respond with Link", "type": "main", "index": 0 } ] ] }, "Archive to Notion": { "main": [ [ { "node": "Respond with Link", "type": "main", "index": 0 } ] ] } }}
⚙️ 使用与注意事项(必读)
替换凭证:把 OPENAI_CRED_ID、NOTION_CRED_ID、YOUR_NOTION_PPT_DB_ID、以及所有 api.example.com / api.your-oss.com 占位替换成你自己的服务或供应商。
PPT 生成 API:示例用了 https://api.example.com/generate-ppt 作为占位。你可以替换成:
使用第三方 PPT 服务(SlidesAI、DeckRobot 等)
使用 Google Slides API(需额外实现 slides 组装逻辑)
自建微服务(接收 JSON,返回 PPT)
图片生成:如果你不想为每张幻灯片生成图片,可删除 Image 节点并在 Create PPT 时只传文字内容。
并发与配额:生成大量图片或调用 OpenAI 会消耗配额,请先测试少量幻灯片(1–3 页)确认效果与成本。
调试流程:导入后逐节点 Execute Node 调试,检查 OpenAI 输出是否为 JSON(Parse Slides JSON 节点有简单的容错解析)。
扩展:我可以把 Create PPT 节点替换为 Google Slides 的完整实现,或把图片生成替换为 Midjourney / Stability / DALL·E 池化调用(批量队列模式)。
如果觉得不错,随手点个关注,点个赞呗,如果想第一时间接收主动,也可以给我个星标⭐~谢谢你看我的文章。