sheets-automation

sheets-automation

熱門

Google Sheets 自動化工作流程 - 資料同步、任務管理、報表儀表板與多平台整合

313星標
68分支
更新於 2026/1/31
SKILL.md
唯讀
名稱
sheets-automation
描述

Google Sheets 自動化工作流程 - 資料同步、任務管理、報表儀表板與多平台整合

版本
1.0.0

Google Sheets 自動化

自動化 Google Sheets 工作流程,實現資料同步、任務管理、報表儀表板與多平台整合。基於 n8n 的 7,800 多個工作流程模板。

概述

本技能涵蓋:

  • 從多個來源自動同步資料
  • 搭配 Slack 提醒的任務管理
  • 即時報表儀表板
  • CRM/行銷資料彙整
  • 排程報表產生

核心工作流程

1. 多來源資料彙整

┌─────────────┐   ┌─────────────┐   ┌─────────────┐
│ HubSpot     │   │ Stripe      │   │ Google      │
│ (CRM)       │   │ (付款)      │   │ Analytics   │
└──────┬──────┘   └──────┬──────┘   └──────┬──────┘
       │                 │                 │
       └─────────────────┼─────────────────┘
                         │
                         ▼
              ┌──────────────────┐
              │ Google Sheets    │
              │ (主儀表板)       │
              └──────────────────┘
                         │
                         ▼
              ┌──────────────────┐
              │ Slack/Email      │
              │ (每日報表)       │
              └──────────────────┘

n8n 設定:

workflow: "每日業務指標同步"

schedule: "每天 6:00 AM"

steps:
  1. fetch_crm_data:
      source: hubspot
      data:
        - new_leads_today
        - deals_closed
        - pipeline_value
        
  2. fetch_revenue_data:
      source: stripe
      data:
        - mrr
        - new_subscriptions
        - churn
        
  3. fetch_traffic_data:
      source: google_analytics
      data:
        - sessions
        - conversions
        - bounce_rate
        
  4. update_sheets:
      spreadsheet: "Business Dashboard"
      sheet: "Daily Metrics"
      action: append_row
      data:
        - date: today
        - leads: "{hubspot.new_leads}"
        - deals: "{hubspot.deals_closed}"
        - mrr: "{stripe.mrr}"
        - sessions: "{ga.sessions}"
        
  5. update_charts:
      refresh: automatic (Sheets 內建)
      
  6. send_summary:
      slack:
        channel: "#daily-metrics"
        message: |
          📊 每日指標 - {date}
          
          💰 營收: ${mrr} MRR
          👥 新客戶: {leads}
          🎯 成交案件: {deals}
          📈 網站流量: {sessions}

2. 任務管理與提醒

workflow: "Sheets 任務追蹤器"

trigger:
  type: schedule
  frequency: every_15_minutes

sheet_structure:
  columns:
    - A: 任務
    - B: 負責人
    - C: 截止日期
    - D: 優先級 (高/中/低)
    - E: 狀態 (待辦/進行中/完成)
    - F: Slack ID

steps:
  1. read_tasks:
      filter: |
        Status != "Done" AND
        Due Date <= TODAY() + 1
        
  2. categorize_urgency:
      overdue: Due Date < TODAY()
      due_today: Due Date == TODAY()
      due_tomorrow: Due Date == TODAY() + 1
      
  3. send_reminders:
      for_each: task
      
      overdue:
        slack_dm:
          to: "{assignee_slack_id}"
          message: |
            🚨 *已逾期*: {task_name}
            截止日: {due_date} (逾期 {days_overdue} 天)
            優先級: {priority}
            
      due_today:
        slack_dm:
          to: "{assignee_slack_id}"
          message: |
            ⏰ *今天到期*: {task_name}
            優先級: {priority}
            
  4. daily_recap:
      schedule: "6:00 PM"
      slack_channel: "#team"
      message: |
        📋 *每日任務摘要*
        
        ✅ 已完成: {completed_count}
        ⏳ 進行中: {in_progress_count}
        🚨 逾期: {overdue_count}
        
        明天優先事項:
        {tomorrow_tasks}

3. 自動報表產生

workflow: "週報產生器"

schedule: "星期五 5:00 PM"

steps:
  1. collect_data:
      sheets:
        - "銷售資料"
        - "行銷指標"
        - "客服案件"
        
  2. calculate_metrics:
      sales:
        - total_revenue: SUM(revenue_column)
        - deals_closed: COUNT(won_deals)
        - avg_deal_size: AVG(deal_value)
        - win_rate: won / (won + lost)
        
      marketing:
        - leads_generated: COUNT(new_leads)
        - cost_per_lead: spend / leads
        - conversion_rate: conversions / visitors
        
      support:
        - tickets_resolved: COUNT(resolved)
        - avg_response_time: AVG(first_response)
        - csat_score: AVG(satisfaction)
        
  3. generate_report:
      format: google_doc
      template: "週報模板"
      sections:
        - executive_summary
        - sales_performance
        - marketing_metrics
        - customer_support
        - next_week_priorities
        
  4. create_charts:
      google_sheets:
        - revenue_trend: line_chart
        - deal_funnel: bar_chart
        - lead_sources: pie_chart
        
  5. distribute:
      email:
        to: leadership_team
        subject: "週業務報表 - 第 {week_number} 週"
        attach: [report_doc, charts_pdf]
        
      slack:
        channel: "#leadership"
        message: "📊 週報已就緒: {doc_link}"

4. 庫存/存貨追蹤

workflow: "庫存警示系統"

trigger:
  type: sheets_change
  sheet: "Inventory"
  
sheet_structure:
  columns:
    - 產品
    - SKU
    - 目前庫存
    - 補貨點
    - 供應商
    - 前置時間 (天)

steps:
  1. check_stock_levels:
      condition: Current Stock <= Reorder Level
      
  2. generate_alerts:
      for_each: low_stock_item
      actions:
        - update_cell:
            column: "Status"
            value: "REORDER NEEDED"
            format: red_background
            
        - slack_alert:
            channel: "#inventory"
            message: |
              ⚠️ *庫存不足警示*
              
              產品: {product_name}
              SKU: {sku}
              目前庫存: {current_stock}
              補貨點: {reorder_level}
              供應商: {supplier}
              
        - email_supplier:
            if: auto_reorder == true
            template: "reorder_request"
            
  3. daily_summary:
      schedule: "9:00 AM"
      report:
        - total_skus: count
        - low_stock_items: count
        - out_of_stock: count
        - pending_orders: list

5. 表單回覆 → CRM + Slack

workflow: "Google 表單客戶擷取"

trigger:
  type: google_forms
  form: "聯絡我們表單"
  
steps:
  1. capture_response:
      fields: [name, email, company, message, source]
      
  2. append_to_sheet:
      spreadsheet: "Lead Tracker"
      data:
        - timestamp: NOW()
        - name: "{name}"
        - email: "{email}"
        - company: "{company}"
        - message: "{message}"
        - status: "New"
        
  3. enrich_lead:
      clearbit:
        lookup_by: email
        append: [company_size, industry, linkedin]
        
  4. create_in_crm:
      hubspot:
        object: contact
        properties:
          email: "{email}"
          firstname: "{name}"
          company: "{company}"
          lead_source: "Website Form"
          
  5. notify_sales:
      slack:
        channel: "#new-leads"
        message: |
          🎉 *新客戶!*
          
          👤 {name}
          🏢 {company} ({company_size} 名員工)
          📧 {email}
          💬 "{message}"
          
          [在 HubSpot 中檢視]({hubspot_link})
          
  6. auto_respond:
      email:
        to: "{email}"
        template: "thank_you_for_contacting"

試算表模板

銷售儀表板

┌────────────────────────────────────────────────────────────────┐
│                    銷售儀表板 - {月份}                         │
├────────────────────────────────────────────────────────────────┤
│                                                                │
│  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐          │
│  │ 營收    │  │ 成交件數│  │ 平均金額│  │ 勝率    │          │
│  │ $125K   │  │ 23      │  │ $5,400  │  │ 34%     │          │
│  │ ▲ 15%   │  │ ▲ 8%    │  │ ▲ 12%   │  │ ▼ 2%   │          │
│  └─────────┘  └─────────┘  └─────────┘  └─────────┘          │
│                                                                │
│  [營收趨勢圖 - 折線圖]                                         │
│ [管道階段 - 漏斗圖]                                           │
│ [頂尖業務 - 長條圖]                                           │
│                                                                │
├────────────────────────────────────────────────────────────────┤
│ 日期     │ 案件      │ 金額    │ 業務  │ 階段    │ 機率     │
│ 1/30     │ Acme Corp │ $15,000 │ Alice │ 提案    │ 60%      │
│ 1/29     │ Tech Inc  │ $8,500  │ Bob   │ 展示    │ 40%      │
│ ...      │ ...       │ ...     │ ...   │ ...     │ ...      │
└────────────────────────────────────────────────────────────────┘

行銷追蹤

┌────────────────────────────────────────────────────────────────┐
│                     行銷指標                                    │
├────────────────────────────────────────────────────────────────┤
│ 管道       │ 花費    │ 客戶數│ 單價  │ 轉換率 │ 營收       │
├─────────────┼──────────┼───────┼────────┼────────┼───────────┤
│ Google Ads  │ $5,000   │ 150   │ $33    │ 3.2%   │ $45,000   │
│ Facebook    │ $3,000   │ 200   │ $15    │ 1.8%   │ $28,000   │
│ LinkedIn    │ $2,500   │ 50    │ $50    │ 5.5%   │ $35,000   │
│ 自然流量    │ $0       │ 300   │ $0     │ 2.1%   │ $52,000   │
├─────────────┼──────────┼───────┼────────┼────────┼───────────┤
│ 總計       │ $10,500  │ 700   │ $15    │ 2.8%   │ $160,000  │
└────────────────────────────────────────────────────────────────┘

ROAS: 15.2x
最佳管道: LinkedIn (最高轉換率)
行動: 增加 LinkedIn 預算 20%

公式參考

常用自動化公式

# 根據日期自動狀態
=IF(C2<TODAY(), "已逾期", IF(C2=TODAY(), "今天到期", "即將到期"))

# 距離到期天數
=DATEDIF(TODAY(), C2, "D")

# 根據條件自動指派
=IFS(B2="Enterprise", "Alice", B2="Mid-Market", "Bob", TRUE, "Carol")

# 計算轉換率
=IFERROR(D2/C2, 0)

# 累計總和
=SUMIF($A$2:A2, "<="&A2, $B$2:B2)

# 條件式格式觸發
=AND($E2="High", $F2<TODAY())

# 從其他工作表 VLOOKUP
=VLOOKUP(A2, 'Reference Data'!$A:$C, 3, FALSE)

# 儀表板查詢
=QUERY(Data!A:F, "SELECT A, SUM(C) WHERE B='Closed Won' GROUP BY A")

輸出範例

請求: "設定從 Google Sheets 自動發送任務提醒"

輸出:

# 任務提醒系統設定

## 試算表結構

建立一個名為「Tasks」的工作表,包含以下欄位:

| A | B | C | D | E | F |
|---|---|---|---|---|---|
| 任務 | 負責人 | 截止日期 | 優先級 | 狀態 | Slack ID |
| 審查提案 | Alice | 2026-01-31 | 高 | 進行中 | U12345 |
| 更新文件 | Bob | 2026-02-01 | 中 | 待辦 | U67890 |

## 自動化工作流程

```yaml
trigger: 每 15 分鐘
actions:
  1. 檢查 24 小時內到期的任務
  2. 發送 Slack 私訊給負責人
  3. 下午 6 點發布每日摘要

範例提醒

逾期警示:

🚨 *已逾期*: 審查提案
截止日: 1 月 29 日 (逾期 1 天)
優先級: 高

請更新狀態或標記完成。

今天到期:

⏰ *今天到期*: 更新文件
優先級: 中

你可以的!💪

每日摘要 (下午 6 點):

📋 *每日任務摘要*

✅ 今日完成: 5
⏳ 進行中: 3
🚨 逾期: 1

明天優先事項:
• 審查提案 (高) - Alice
• 客戶電話準備 (高) - Bob

設定步驟

  1. 建立上述結構的 Google 試算表
  2. 設定 n8n 工作流程,使用排程觸發器
  3. 連接 Google Sheets 和 Slack 節點
  4. 用範例任務測試
  5. 啟用工作流程

需要完整的 n8n 工作流程 JSON 嗎?


---

*Sheets 自動化技能 - Claude Office Skills 系列*