ChatGPT工作后台运营AI 评分 · 待评分AI 辅助编辑·未发现明显提示词注入风险n8n.io

每日自动财务高管简报:Google Sheets + GPT-4o-mini + Notion + Telegram

工作日 7 AM 定时触发 → 并行拉取 5 张 Google Sheets → 计算 KPI → GPT-4o-mini 生成 Telegram 格式简报 → Notion 存档 + Telegram 推送 → 收入跌幅超 10% 临界警报 → Slack 错误告警

有一点经验步骤流程提示词
给谁
需要每日向高管推送财务简报的运营/财务人员,或希望自动化 CFO 看板的小型团队
你会得到
工作日早晨自动收到一份 Telegram 格式的 AI 财务简报,关键指标异常时触发额外警报,执行记录保存至 Notion
你需要
n8n · google-sheets · notion · telegram · slack

硬约束

前置条件:n8n 实例(自托管或云);Google Sheets OAuth2 凭证及 5 张工作表(CashFlow、Revenue、Payroll、Subscriptions、Expenses);OpenAI API 密钥;Notion 集成及 CFO Report 数据库;Telegram Bot 及目标 Chat ID;Slack OAuth2 及告警频道。费用:OpenAI GPT-4o-mini 按 token 计费,其余服务按各自平台标准。未实测,首次运行建议手动触发验证。

他们做了什么

作者 rahul08 在 n8n 模板平台发布了一个 25 节点的工作流模板。该模板通过 Schedule Trigger 在工作日 7 AM 自动触发,并行从 5 张 Google Sheets 工作表(CashFlow、Revenue、Payroll、Subscriptions、Expenses)拉取最新数据,经 Merge 节点汇总后,由 Code 节点计算收入、薪资、营销 ROI、现金跑道等 KPI 及状态标签(GOOD/WARNING/ALERT)。随后 AI Agent 节点调用 GPT-4o-mini,依据结构化 systemMessage 和用户提示词生成 Telegram 格式的执行简报,再经 Code 节点将简报与财务数据合并,最终同时推送至 Telegram 频道和 Notion 数据库。若收入环比跌幅超过 10%,If 节点触发额外的 Telegram 临界警报。工作流另设 Error Trigger → Slack 分支,用于捕获并告警执行失败。

效果如何

来源报告(author_report):模板在 n8n.io 平台标记为 published,共 98 次浏览。未提供具体运行成功率、延迟数据或 ROI。本站未实测,实际效果取决于凭证配置、表格数据质量及 OpenAI API 可用性。

值得知道

1) 营销 ROI 的 baseline 在 KPI 代码中硬编码为 85,若你的基准不同需手动修改。2) Slack 错误告警节点的 text 仅为占位符 '=Error occured ',生产环境建议补充工作流名称、节点名、错误时间等变量。3) 所有凭证(Google Sheets、Notion、OpenAI、Telegram、Slack)均需通过 n8n 凭证管理器配置,禁止直接粘贴密钥到节点字段。4) 首次使用前务必手动触发验证,确认各节点字段映射与实际表格列名一致。5) 来源未提供该模板在真实业务场景中的长期运行记录,稳定性需自行观察。

n8n 工作流模板

结构已检查 · 未实际运行

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

配置与测试清单

需要绑定的凭证

  • Send Daily Briefing to Telegram 节点:绑定Telegram API 凭证。
  • Slack: Error Alert 节点:绑定Slack OAuth2 凭证。

需要替换的配置

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

测试输入与预期结果

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

模板处理说明

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

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

步骤

  1. 配置定时触发器

    在 n8n 中添加 Schedule Trigger 节点,设置 cron 表达式为 0 7 * * 1-5(周一至周五 7:00 执行)。手动点击「Test Workflow」确认触发器能正常启动。

  2. 配置 5 张 Google Sheets 并行拉取

    为 CashFlow、Revenue、Payroll、Subscriptions、Expenses 各添加一个 Google Sheets 节点(typeVersion 4)。在每个节点中:选择或新建 googleSheetsOAuth2Api 凭证;将 documentId 从 YOUR_GOOGLE_SHEET_ID 替换为你的实际表格 ID;确认 sheetName 对应正确的工作表标签。5 个节点均连接到 Weekday 7 AM Trigger 的同一输出,实现并行拉取。

  3. 合并所有表格数据

    添加 Merge 节点(typeVersion 3.2),设置 numberInputs 为 5。将 5 个 Google Sheets 节点的输出分别连接到 Merge 节点的 5 个输入端(index 0–4)。确认合并后数据包含各工作表的原始行。

  4. 计算 KPI 与状态标签

    添加 Code 节点(typeVersion 2,JavaScript),粘贴以下代码。该节点按 sheet 名称或字段存在性过滤输入项,计算当前/上期收入、薪资、营销 ROI、现金余额、月燃烧率、跑道月数、订阅 MRR、总支出,并输出 GOOD/WARNING/ALERT 状态标签。

    运行提示词 · 来源原文。Calculate KPIs & Status Labels 节点的 JS Code 字段

    const allItems = $input.all();
    
    const cashflowData = allItems.filter(i => i.json.sheet === 'CashFlow' || i.json.cash_in !== undefined);
    const revenueData = allItems.filter(i => i.json.sheet === 'Revenue' || i.json.revenue_current !== undefined);
    const payrollData = allItems.filter(i => i.json.sheet === 'Payroll' || i.json.payroll_current !== undefined);
    const subscriptionData = allItems.filter(i => i.json.sheet === 'Subscriptions' || i.json.subscription_revenue !== undefined);
    const expensesData = allItems.filter(i => i.json.sheet === 'Expenses' || i.json.expense_amount !== undefined);
    
    const totalRevenueCurrent = revenueData.reduce((sum, i) => sum + (parseFloat(i.json.revenue_current) || 0), 0);
    const totalRevenuePrevious = revenueData.reduce((sum, i) => sum + (parseFloat(i.json.revenue_previous) || 0), 0);
    const revenueChange = totalRevenuePrevious > 0 ? (((totalRevenueCurrent - totalRevenuePrevious) / totalRevenuePrevious) * 100).toFixed(1) : 0;
    
    const totalPayrollCurrent = payrollData.reduce((sum, i) => sum + (parseFloat(i.json.payroll_current) || 0), 0);
    const totalPayrollPrevious = payrollData.reduce((sum, i) => sum + (parseFloat(i.json.payroll_previous) || 0), 0);
    const payrollChange = totalPayrollPrevious > 0 ? (((totalPayrollCurrent - totalPayrollPrevious) / totalPayrollPrevious) * 100).toFixed(1) : 0;
    
    const totalMarketingSpend = expensesData.reduce((sum, i) => sum + (parseFloat(i.json.marketing_spend) || 0), 0);
    const totalMarketingRevenue = revenueData.reduce((sum, i) => sum + (parseFloat(i.json.marketing_attributed_revenue) || 0), 0);
    const marketingROI = totalMarketingSpend > 0 ? ((totalMarketingRevenue / totalMarketingSpend) * 100).toFixed(1) : 0;
    const marketingROIPrevious = 85;
    const marketingROIChange = (marketingROI - marketingROIPrevious).toFixed(1);
    
    const currentCash = cashflowData.reduce((sum, i) => sum + (parseFloat(i.json.cash_balance) || 0), 0);
    const monthlyBurnRate = expensesData.reduce((sum, i) => sum + (parseFloat(i.json.monthly_burn) || 0), 0);
    const cashRunway = monthlyBurnRate > 0 ? (currentCash / monthlyBurnRate).toFixed(1) : 'N/A';
    
    const totalSubscriptions = subscriptionData.reduce((sum, i) => sum + (parseFloat(i.json.subscription_revenue) || 0), 0);
    const totalExpenses = expensesData.reduce((sum, i) => sum + (parseFloat(i.json.expense_amount) || 0), 0);
    
    const today = new Date().toISOString().split('T')[0];
    
    const revenueStatus = revenueChange < -10 ? '🔴 ALERT' : revenueChange < 0 ? '🟡 WARNING' : '🟢 GOOD';
    const payrollStatus = payrollChange > 10 ? '🔴 ALERT' : payrollChange > 5 ? '🟡 WARNING' : '🟢 GOOD';
    const cashRunwayStatus = parseFloat(cashRunway) < 3 ? '🔴 CRITICAL' : parseFloat(cashRunway) < 6 ? '🟡 WARNING' : '🟢 HEALTHY';
    const marketingStatus = marketingROIChange > 0 ? '🟢 IMPROVING' : '🟡 DECLINING';
    
    return [{
      json: {
        date: today,
        revenue_current: totalRevenueCurrent,
        revenue_previous: totalRevenuePrevious,
        revenue_change_pct: parseFloat(revenueChange),
        payroll_current: totalPayrollCurrent,
        payroll_change_pct: parseFloat(payrollChange),
        marketing_roi: parseFloat(marketingROI),
        marketing_roi_change: parseFloat(marketingROIChange),
        cash_balance: currentCash,
        monthly_burn_rate: monthlyBurnRate > 0 ? monthlyBurnRate / allItems.filter(i => i.json.monthly_burn).length : 0,
        cash_runway_months: parseFloat(cashRunway),
        subscriptions_mrr: totalSubscriptions,
        total_expenses: totalExpenses,
        revenue_status: revenueStatus,
        payroll_status: payrollStatus,
        cash_status: cashRunwayStatus,
        marketing_status: marketingStatus
      }
    }];
  5. 配置 AI Agent 生成简报

    添加 AI Agent 节点(@n8n/n8n-nodes-langchain.agent,typeVersion 3,promptType: define)。将 OpenAI GPT-4o-mini 子节点(@n8n/n8n-nodes-langchain.lmChatOpenAi,typeVersion 1.3,model: gpt-4o-mini)连接到该 Agent 的 ai_languageModel 输入。在 Agent 节点的 options.systemMessage 和 text 字段分别填入以下提示词。text 字段中的 {{ $json.* }} 变量会自动引用上一步 KPI 节点的输出。

    运行提示词 · 来源原文。Generate AI Outreach Message1 节点的 options.systemMessage 字段

    You are a senior CFO assistant. Your job is to turn raw financial KPI data into a sharp, scannable executive briefing for Telegram. Rules: use Telegram Markdown (*bold* for labels), include emojis for each section, keep total length under 350 words, be direct and action-oriented — if a metric is at WARNING or ALERT status call out the specific recommended action, otherwise just confirm it is healthy. Never add filler sentences.

    运行提示词 · 来源原文。Generate AI Outreach Message1 节点的 text 字段(用户提示词)

    =You are an expert CFO assistant. Write a concise daily financial briefing for the executive team based on the data below. Format it for Telegram using *bold* for section labels. Use emojis for quick scanning. Be direct, highlight what changed and what action (if any) is needed. Keep it under 350 words.
    
    📅 Report Date: {{ $json.date }}
    
    💰 REVENUE
    - Current: ${{ $json.revenue_current }}
    - Previous: ${{ $json.revenue_previous }}
    - Change: {{ $json.revenue_change_pct }}%
    - Status: {{ $json.revenue_status }}
    
    👥 PAYROLL
    - Current: ${{ $json.payroll_current }}
    - Change: {{ $json.payroll_change_pct }}%
    - Status: {{ $json.payroll_status }}
    
    📣 MARKETING ROI
    - ROI: {{ $json.marketing_roi }}%
    - Change vs baseline: {{ $json.marketing_roi_change }}%
    - Status: {{ $json.marketing_status }}
    
    🏦 CASH POSITION
    - Balance: ${{ $json.cash_balance }}
    - Monthly Burn: ${{ $json.monthly_burn_rate }}
    - Runway: {{ $json.cash_runway_months }} months
    - Status: {{ $json.cash_status }}
    
    📦 SUBSCRIPTIONS MRR: ${{ $json.subscriptions_mrr }}
    💸 TOTAL EXPENSES: ${{ $json.total_expenses }}
    
    End with a 1–2 line executive summary highlighting the single most important insight today.
  6. 合并 AI 简报与财务数据

    添加 Code 节点(typeVersion 2),粘贴以下代码。该节点将 AI Agent 的输出(output)与 KPI 数据合并,生成包含 telegram_report 字段的完整对象,供下游 Notion 和 Telegram 节点使用。

    运行提示词 · 来源原文。Merge AI Report + Financial Data 节点的 JS Code 字段

    const aiOutput = $('Generate AI Outreach Message1').item.json.output || '';
    const financialData = $('Calculate KPIs & Status Labels').item.json;
    
    return [{
      json: {
        ...financialData,
        telegram_report: aiOutput
      }
    }];
  7. 配置推送与存档

    从 Merge AI Report + Financial Data 节点引出 3 条分支: 1) Notion 节点(typeVersion 2,resource: databasePage):设置 databaseId 为你的 CFO Report 数据库 ID;title 使用 =CFO Report — {{ $json.date }};blockUi 和 propertiesUi 填入 {{ $json.telegram_report }} 与 {{ $json.marketing_status }}。 2) Telegram 节点(typeVersion 1.1):设置 chatId 为目标 Chat ID;text 使用 {{ $json.telegram_report }};additionalFields.parse_mode 设为 Markdown。 3) If 节点(typeVersion 2,Check for Critical Revenue Drop):条件为 revenue_change_pct < -10(number/lt)。True 分支连接到第二个 Telegram 节点发送临界警报。

    运行提示词 · 来源原文。Send Critical Revenue Alert 节点的 text 字段

    =🚨 *CRITICAL CFO ALERT — {{ $json.date }}*
    
    ⚠️ Revenue has dropped {{ $json.revenue_change_pct }}% — immediate attention required!
    
    💰 Cash Runway: {{ $json.cash_runway_months }} months
    🔥 Monthly Burn: ${{ $json.monthly_burn_rate }}
    
    Check the full report in Notion now.
  8. 配置错误告警

    添加 Error Trigger 节点(typeVersion 1)和 Slack 节点(typeVersion 2.3)。Error Trigger 连接到 Slack 节点的输入。在 Slack 节点中:选择 channel 模式并指定目标频道;authentication 设为 oAuth2;text 当前为占位符 '=Error occured ',建议替换为包含工作流名称与错误详情的模板。该分支独立于主流程,用于捕获任意节点失败。

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限,再按步骤复现

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

你正在复现一个 n8n 工作流模板:每日自动财务高管简报。请按以下顺序操作:1) 确认你已拥有 n8n 实例及所有必需凭证(Google Sheets OAuth2、OpenAI、Notion、Telegram Bot、Slack OAuth2);2) 导入 workflow.json 或按步骤手动搭建;3) 将 YOUR_GOOGLE_SHEET_ID、YOUR_NOTION_DATABASE_ID、YOUR_TELEGRAM_CHAT_ID 替换为实际值;4) 手动触发一次,验证 5 张表数据能正常拉取、KPI 计算无误、AI 简报生成且 Telegram 消息送达;5) 检查收入下跌 10% 的临界警报分支(可通过临时修改测试数据验证);6) 确认 Slack 错误告警频道能收到通知。如遇凭证权限问题,优先检查 Google Sheets 共享设置与 Notion 集成权限。

本模板无单一「运行提示词」;核心执行内容已分散在步骤 4(KPI 计算代码)、步骤 5(AI Agent system/user 提示词)、步骤 6(合并代码)、步骤 7(Telegram 临界警报模板)中。

来源

Send daily executive financial briefings with Google Sheets, GPT-4o-mini, Notion and Telegram · rahul08 · n8n.io · 2026-06-17

留言与反馈

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

正在加载…

    相关用例