用 n8n 自动生成并发布 Instagram 轮播图
输入一个主题 → Gemini 生成 6 页脚本 → Google Slides 模板替换 → 提取缩略图 → ImgBB 托管 → Meta API 发布到 Instagram → Google Sheets 记录
- 给谁
- 需要定期发布 Instagram 教育类轮播图的内容运营者、设计师或营销团队
- 你会得到
- 每日自动生成并发布一套 6 页 Instagram 轮播图,无需手动设计
- 你需要
- n8n · google-slides · google-sheets · google-drive · imgbb
硬约束
前置条件:n8n 实例;Google Cloud 项目(启用 Drive/Slides/Sheets/Gemini API);Meta Developer 应用(Instagram Business 账号 + System User Token,权限 instagram_basic、instagram_content_publish、pages_read_engagement);ImgBB 免费 API Key;作者提供的 Google Slides 和 Google Sheets 模板副本。费用:Google Cloud 按量计费;ImgBB 免费版有速率限制;Meta API 免费额度内可用。
他们做了什么
作者 Bakdaulet Abdikhan 在 n8n 官方模板库发布了此工作流模板。模板展示了一个端到端自动化:由 Gemini 生成 6 页教育类轮播图脚本,通过 Google Slides API 复制模板并替换占位符文本,提取幻灯片缩略图,经 ImgBB 获取公开 URL,最终通过 Meta Graph API 发布为 Instagram 轮播图,并将结果记录到 Google Sheets。模板包含 36 个节点,涵盖定时触发、AI Agent、结构化输出解析、Google Drive/Slides/Sheets、HTTP Request、Wait、If、Code 等节点类型。
效果如何
作者自述该模板可将单主题转化为已发布 Instagram 轮播图的时间从数小时缩短至分钟级(author_report)。模板在 n8n.io 上获得 973 次查看。本站未实测运行,未验证实际发布成功率或 API 稳定性。
值得知道
Meta Graph API 在模板中存在版本不一致:media 上传和容器创建使用 v24.0,而 media_publish 使用 v22.0,来源未说明原因,搭建时需留意版本兼容性。Google Slides 模板的 13 个占位符名称必须与替换节点中的 text 字段精确匹配(包括大小写和拼写,如 {{problem_tile}} 与 {{matter_tile}}),否则替换失败。ImgBB 免费账户有上传速率和存储限制,长期高频使用需评估稳定性。模板未展示错误处理分支(如 Meta API 拒绝、ImgBB 上传失败),生产环境建议补充。作者提供了 Google Slides 模板链接,但 UKnowHow 未托管该模板,使用者需自行复制并验证占位符对应关系。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- Duplicate carousel template 节点:绑定Google Drive OAuth2 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #12413(约 36 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
配置内容生成节点
在 n8n 中导入模板后,定位 'Generate carousel content' AI Agent 节点。确认已连接 'Google Gemini Chat Model'(模型选择 gemini-2.5-pro)和 'Structured Output Parser'。节点使用 define prompt 模式,提示词已内置在模板中。检查输出解析器的 JSON Schema 是否包含 hook、mistake、why_it_matters、value、tip、cta、post_description 七个字段。
运行提示词 · 来源原文。'Generate carousel content' AI Agent 节点的 Text 字段(define prompt 模式)
=You are a professional web design content generator who writes daily carousel post scripts for social media. Each post educates web designers, business owners, and marketers about website design, UI/UX, and conversion psychology. Your task is to produce one complete post script per day in JSON format, with the following consistent structure of 6 slides: 1. Hook 2. Mistake 3. Why It Matters 4. Value 5. Tip 6. CTA You also write post description for the post, it is as same as post script but all is one text with cta, give it in json 🧩 Content Style: - Hook should be emotional, and curiosity-driven. - Hook description should make readers want to scroll till the last slide, only few words (“the last one is crucial”, etc.). - Mistake must highlight a painful or common problem web designers or businesses make. - Why It Matters should emotionally and logically explain the consequence of that mistake. - Value gives actionable insights or truth behind fixing it. - Tip should provide short 3 practical steps or advice that can be implemented quickly. - CTA encourages engagement by commenting “+” or similar to improve their website. 🎯 Topics to rotate daily: - Web design psychology - Homepage conversion - UI/UX tips - Figma or Framer best practices - Copywriting for web - Color, layout, and typography - Client communication and web strategy ⚙️ Rules: - Do NOT add markdown, explanations, or extra text — only raw JSON. - Each field must be short and engaging (no long paragraphs). - Never repeat the same CTA — always rephrase slightly. - Focus on actionable, painful, or surprising insights that push the reader to comment or save. - Make the tone natural, confident, and conversational. - Never use emojis or signs - For the cta always use the "+" to enfourage them - Tone: Spartan casual - In cta dont say like "comment a +", say "comment +" without article Example output, dont copy this data: { "hook": { "title": "Your fonts might be ruining your design ", "description": "The last part fixes it." }, "mistake": { "title": "Inconsistency", "content": "Using 3–4 random fonts across pages makes your design feel unstructured. It breaks brand trust and looks unprofessional instantly." }, "why_it_matters": { "title": "Visual Harmony", "content": "Typography defines how users *feel* when reading. If your font styles jump around, users subconsciously think your brand is unstable." }, "value": { "title": "Consistency Builds Trust", "content": "When you use one or two well-paired fonts, your site feels cleaner, easier to scan, and more premium — even without complex visuals." }, "tip": { "title": "Keep It Simple", "tip_1": "Use 1 display font for headings and 1 readable font for body.", "tip_2": "Limit weights to 2–3 max.", "tip_3": "Stick to 16–18px body size for clarity." }, "cta": { "content": "Drop a '+' if you want me to check your font setup " }, "post_description": { "caption": "DescriptionGoesHere" } }配置 Google Slides 模板替换
复制作者提供的 Google Slides 模板到你的 Drive(模板链接见 sticky note)。在 'Duplicate carousel template' Google Drive 节点中,将 fileId 替换为你的模板副本 ID。在 'Replace text in template' Google Slides 节点中,确认 13 组 find/replace 规则与你的模板占位符完全匹配:{{hook}}、{{hook_description}}、{{problem_tile}}、{{problem_description}}、{{matter_tile}}、{{matter_description}}、{{value_tile}}、{{value_description}}、{{tip_tile}}、{{Tip_1}}、{{Tip_2}}、{{Tip_3}}、{{CTA}}。运行一次测试,检查副本中的文本是否被正确替换。
配置图片提取与托管
'Get slides (carousels)' 节点从替换后的演示文稿获取所有幻灯片列表。'Loop carousel slides' 节点分批处理。对每张幻灯片,'get the imgs from slides' 调用 Google Slides API 获取缩略图(download=true),'convert' 节点将二进制转为属性,'make a link' 通过 HTTP Request 以 multipart/form-data POST 到 https://api.imgbb.com/1/upload,参数 key=YOUR_IMGBB_KEY_HERE,body 中 image 为 base64 编码。将 YOUR_IMGBB_KEY_HERE 替换为实际 ImgBB API Key。
配置 Meta 发布与轮询
'slide 1' 至 'slide 6' 六个 HTTP Request 节点分别向 https://graph.facebook.com/v24.0/YOUR_INSTAGRAM_ACCOUNT_ID_HERE/media POST,参数为 image_url(来自 ImgBB 返回的 URL)和 caption。将 YOUR_INSTAGRAM_ACCOUNT_ID_HERE 替换为实际账号 ID。'Container HTTP Carousel1' 节点创建轮播容器,children 为六个 slide 的返回 id,media_type=CAROUSEL。'🔍 Check Processing Status2' 保存 container_id。'⏰ Initial Processing Wait1' 等待后,'Check publish status' 查询容器状态(fields=status_code)。'Is carousel ready' 判断是否为 FINISHED;否 -> 'Retry publish check in 5 seconds' 循环;是 -> 'publish' 调用 https://graph.facebook.com/v22.0/YOUR_INSTAGRAM_ACCOUNT_ID_HERE/media_publish POST,参数 creation_id。
配置日志记录与定时触发
'add data' 节点将日期、caption、6 个 slide URL 追加到 Google Sheets(需替换 documentId 为你的 Sheet ID)。'get data' 读取全部数据,'get last row' Code 节点用 JavaScript 取最后一行。'update status' 以 slide_1 为匹配列,将 status 更新为 published。'Run daily schedule' 节点默认每日 6 点触发,可按需调整。激活 workflow 后,点击 Execute 测试或等待定时触发。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限,再按步骤检查节点参数
这一段是提示词,页面不会在这里插入广告。
你正在搭建一个 n8n 自动化流程,用于每日生成并发布 Instagram 教育类轮播图。请先确认以下前置条件是否就绪: 1. n8n 实例(云或自托管) 2. Google Cloud 项目,已启用 Drive、Slides、Sheets、Gemini API,且已创建 OAuth2 凭证 3. Meta Developer 应用,已关联 Instagram Business 账号,拥有 System User Token(权限:instagram_basic、instagram_content_publish、pages_read_engagement) 4. ImgBB 账号及 API Key 5. 复制作者的 Google Slides 模板和 Google Sheets 模板到你的 Drive 确认后,按步骤检查节点凭证和参数替换(Instagram Account ID、ImgBB Key、模板 ID、Sheet ID),先用 Execute 测试单轮,观察 Google Sheets 是否成功记录状态。
先跑通凭证连接测试,再验证单张 slide 的 Meta API 权限,最后执行完整 6-slide 轮播。
来源
Generate and publish Instagram carousels with Gemini and Google Slides · bakdaulet-abdikhan · n8n.io · 2026-01-03
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。