ChatGPT销售增长营收AI 评分 · 81/100AI 辅助编辑·未发现明显提示词注入风险n8n.io

n8n 自动化 LinkedIn 发帖:OpenAI 生成内容、Google Sheets 审批与邮件确认工作流

从 Google Sheets 读取待发布内容 → OpenAI 生成 LinkedIn 帖子 → Gmail 邮件审批 → 条件发布并回写状态

有一点经验步骤流程提示词
给谁
需要内容审批流程的营销团队或社交媒体运营者
你会得到
自动从表格提取待办内容,由 AI 生成 LinkedIn 帖子,经邮件审批后自动发布并更新表格状态
你需要
n8n · Google Sheets · Gmail · LinkedIn

硬约束

前置条件:n8n 实例;Google Sheet 含列 Post Description、Instructions、Image、Status、Output、Post Link、row_number;凭证类型 openAiApi、googleSheetsOAuth2Api、gmailOAuth2、linkedInOAuth2Api。费用取决于 OpenAI 调用量与 n8n 托管方式。

他们做了什么

模板作者 shindearyan 在 n8n 上构建了一个工作流:通过定时触发器从 Google Sheets 读取待办内容,使用 OpenAI GPT 模型生成 LinkedIn 帖子,经 Gmail 发送带表单的审批邮件,根据审批人回复(Yes/No/Cancel)决定直接发布、修改后重发或取消,并在发布后将状态与链接回写到表格。

效果如何

作者报告该模板可实现完整的创建-审批-发布闭环(author_report)。未提供具体 ROI 或成功率数据。

值得知道

模板中 LinkedIn 的 person 字段硬编码为示例值,需替换为实际账号;row_number 列对精确更新至关重要;图片 URL 为可选项;本站未实际导入运行(reproduction=not_tested),搭建后请先用测试数据手动运行验证。

n8n 工作流模板

结构已检查 · 未实际运行

下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。

配置与测试清单

需要绑定的凭证

  • httpRequest 节点:绑定相关 HTTP / API 密钥(按节点 Header 或 Query 配置)。
  • lmChatOpenAi 节点:绑定OpenAI API 凭证。
  • googleSheets 节点:绑定Google Sheets OAuth2 凭证。
  • gmail 节点:绑定Gmail OAuth2 凭证。
  • linkedIn 节点:绑定LinkedIn OAuth2 凭证。

需要替换的配置

  • 源模板来自 n8n 公开库 #4005(约 18 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
  • Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。

测试输入与预期结果

  • 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
  • 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。

模板处理说明

  • 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
  • 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。

模板获取日期: 2026-10-24

步骤

  1. 准备 Google Sheet 数据表

    创建新 Google Sheet,添加以下列:Post Description(帖子描述)、Instructions(写作指令)、Image(图片 URL,可选)、Status(状态)、Output(输出)、Post Link(发布链接)、row_number(行号,用于精确更新)。填入一行测试数据,将 Status 设为 Pending。

  2. 配置 n8n 凭证

    在 n8n 中创建以下凭证并分配到对应节点:a) Google Sheets OAuth2;b) Gmail OAuth2;c) OpenAI API Key;d) LinkedIn OAuth2。将凭证 ID 填入 workflow JSON 中各节点的 credentials 字段。

  3. 设置触发器与 AI 模型

    在 Schedule Trigger 节点设置运行间隔(如每日上午 9 点)。在 OpenAI Chat Model 节点选择模型(默认 gpt-4o-mini,也可选用 gpt-4o)。如需调整生成风格,可在 Generate Post Content 节点修改提示词。

  4. 生成内容并发送审批邮件

    工作流自动读取 Status=Pending 的首行数据,由 Generate Post Content 节点调用 OpenAI 生成帖子正文,经 Data Formatting 1 节点格式化后,通过 Gmail 发送给审批人。邮件内含自定义表单:下拉选项 Yes/No/Cancel 与修改意见文本框。

    运行提示词 · 来源原文。Generate Post Content 节点的 messages.messageValues[0].message(System 指令)

    =You are an expert social media and LinkedIn content writer.
    
    You will be provided with:
    - A brief post description
    - Specific instructions from the user
    
    Please follow these steps:
    
    1. Initial Creation:
    If you are given a post description and instructions, write a polished, professionally worded LinkedIn post suitable for sharing. Strictly follow the instructions and ensure the message is engaging and succinct.
    If instructed, add a call to action or particular phrase (for example, "Connect with me" at the bottom).
    
    2. Formatting:
    Keep the tone positive, inclusive, and professional.
    Add relevant hashtags in small case.
    Limit the content to within 1300 characters.
    Place the call to action or special instruction at the end if requested.
    Output ONLY the final LinkedIn post content. Do NOT include any explanations, markdown, headings, or commentary—just the post text, ready to copy and share on LinkedIn.

    运行提示词 · 来源原文。Generate Post Content 节点的 text 字段(User 提示词)

    =# LinkedIn Post Generation
    
    ## Post Description:
    {{ $json["Post Description"] }}
    
    ## Instructions:
    {{ $json["Instructions"] }}
    
    ---
    
    **Task:**
    Using the information above, generate the content for a LinkedIn post:
    - Use the Description and Instructions to create a new post.
    - Ensure your output is positive, professional, clear, and follows all provided instructions and feedback.
    - Do not include any explanations, just the final post content only, ready to publish on LinkedIn.
    - Limit to 1300 characters.
    - If the user demands to keep the same post as the Post Descrioption (in the instructions), then keep the same post content as provided in the Post Description, and output it.
  5. 处理审批结果并发布

    Content Confirmation Logic(Switch 节点)根据审批回复路由:Yes→检查是否有图片 URL,有则下载并带图发布(Post With Image),无则纯文本发布(Post Without Image),然后更新 Google Sheet 状态为 Completed 并写入帖子链接;No→将修改意见传入 Regenerate Post Content 节点重新生成,再次发送审批;Cancel→更新 Google Sheet 状态为 Cancelled。

    运行提示词 · 来源原文。Regenerate Post Content 节点的 text 字段

    =Apply the modification requests on the following LinkedIn post. Besides applying the reqested modifications, return the same linkedin post.
    
    LinkedIn post:
    ```
    {{ $('Data Formatting 1').item.json['Post Content'] }}
    ```
    
    Change requests:
    {{ $('Send Content Confirmation').item.json.data['Any Changes?'] }}
    
    **Task:**
    Using the information above, update the LinkedIn post content:
    - Do not include any explanations, just the final post content only (with all the change requests included in the post), ready to publish on LinkedIn.
    - Limit to 1300 characters.
    - If the user demands to keep the same post as the Post Description (in the instructions), then keep the same post content as provided in the Post Description, and output it.

    运行提示词 · 来源原文。Post With Image 节点的 text 字段

    ={{ $('Data Formatting 1').item.json['Post Content'] }}

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限

这一段是提示词,页面不会在这里插入广告。

你正在搭建一个 n8n 工作流,用于自动从 Google Sheets 生成 LinkedIn 内容并经过邮件审批后发布。请先确认:1) Google Sheet 已创建且包含必需列;2) 四个凭证(Google Sheets、Gmail、OpenAI、LinkedIn)已在 n8n 中配置完成;3) 已从模板页导入 workflow JSON 或手动搭建节点。如需修改生成风格,请重点调整 Generate Post Content 节点的 system message 与 user prompt。

搭建前请准备好 Google Sheet 测试数据与四个平台的 OAuth/API 凭证

来源

AI-generated LinkedIn posts with OpenAI, Google Sheets & email approval workflow · shindearyan · n8n.io · 2025-05-12

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例