whatsapp-automation

whatsapp-automation

熱門

WhatsApp Business 自動化 - 客戶支援、通知、聊天機器人與廣播訊息

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

WhatsApp Business 自動化 - 客戶支援、通知、聊天機器人與廣播訊息

版本
1.0.0

WhatsApp 自動化

自動化 WhatsApp Business 通訊,包括客戶支援、通知、聊天機器人與廣播訊息。基於 n8n 的 WhatsApp 整合模板。

概述

此技能涵蓋:

  • WhatsApp Business API 設定
  • 自動化聊天機器人流程
  • 訂單/出貨通知
  • 客戶支援自動化
  • 廣播訊息

設定與配置

WhatsApp Business API

setup_requirements:
  1. meta_business_account:
      - 在 business.facebook.com 建立
      - 驗證商家
      
  2. whatsapp_business_api:
      - 透過 Meta 開發者平台存取
      - 建立 WhatsApp Business 應用程式
      - 取得電話號碼 ID
      - 取得存取權杖
      
  3. webhook_configuration:
      - 設定回呼 URL
      - 驗證權杖
      - 訂閱訊息
      
  4. message_templates:
      - 在 Business Manager 中建立模板
      - 等待審核(24-48 小時)

訊息模板

template_categories:
  transactional:
    - order_confirmation
    - shipping_update
    - delivery_notification
    - appointment_reminder
    
  marketing:
    - promotional_offer
    - product_launch
    - newsletter
    
  utility:
    - account_verification
    - password_reset
    - payment_reminder
    
template_example:
  name: "order_confirmation"
  language: "en"
  category: "TRANSACTIONAL"
  components:
    - type: HEADER
      format: TEXT
      text: "訂單已確認!🎉"
      
    - type: BODY
      text: |
        嗨 {{1}},
        
        您的訂單 #{{2}} 已確認!
        
        商品:{{3}}
        總計:{{4}}
        
        出貨時我們會通知您。
        
    - type: FOOTER
      text: "回覆 HELP 取得支援"
      
    - type: BUTTONS
      buttons:
        - type: URL
          text: "追蹤訂單"
          url: "https://example.com/track/{{1}}"

聊天機器人流程

客戶支援機器人

chatbot_flow:
  name: "客戶支援"
  
  welcome:
    trigger: first_message
    response: |
      👋 歡迎來到 {Company} 客服!
      
      今天有什麼可以幫您的嗎?
      
      1️⃣ 追蹤訂單
      2️⃣ 退貨/換貨
      3️⃣ 產品問題
      4️⃣ 轉接專人
      
      請回覆數字繼續。
      
  flows:
    track_order:
      trigger: "1" OR "track" OR "order"
      steps:
        - ask: "請輸入您的訂單編號:"
        - validate: order_number_format
        - lookup: order_status
        - respond: |
            📦 *訂單 #{order_number}*
            
            狀態:{status}
            {if_shipped: 追蹤編號:{tracking_number}}
            預計送達:{eta}
            
            [追蹤包裹]({tracking_url})
            
    return_exchange:
      trigger: "2" OR "return" OR "exchange"
      steps:
        - ask: "要退貨的訂單編號?"
        - check: return_eligibility
        - if_eligible:
            respond: return_instructions
        - if_not:
            respond: contact_support
            
    product_questions:
      trigger: "3" OR "product" OR "question"
      steps:
        - ai_response:
            model: gpt-4
            context: product_faq_knowledge_base
            
    agent_handoff:
      trigger: "4" OR "agent" OR "human"
      steps:
        - check: agent_availability
        - if_available:
            transfer: to_live_agent
            notify: "#support-queue"
        - if_unavailable:
            respond: "我們的團隊目前無法提供服務。請留言,我們會在 24 小時內回覆您。"
            create: support_ticket

AI 驅動回覆

ai_chatbot:
  model: gpt-4
  
  system_prompt: |
    您是 {Company} 的 WhatsApp 客服人員。
    
    指引:
    - 保持友善與樂於助人
    - 回覆簡潔(WhatsApp 偏好短訊息)
    - 適當使用表情符號
    - 若無法協助,主動提議轉接真人客服
    - 切勿捏造訂單或產品資訊
    
    您可以存取:
    - 訂單查詢
    - 產品目錄
    - 常見問題知識庫
    
  tools:
    - lookup_order: 依訂單編號查詢
    - search_products: 依關鍵字搜尋
    - check_inventory: 依產品 ID 查庫存
    - create_ticket: 處理複雜問題
    
  escalation_triggers:
    - sentiment: very_negative
    - keywords: ["complaint", "refund", "angry", "sue"]
    - loop_detected: same_question_3x

通知工作流程

訂單通知

order_notifications:
  order_placed:
    trigger: shopify_order_created
    template: order_confirmation
    variables:
      - customer_name
      - order_number
      - items_summary
      - total_amount
      
  payment_received:
    trigger: payment_captured
    message: |
      ✅ 訂單 #{order_number} 的款項已收到!
      
      金額:{amount}
      
      我們正在準備您的訂單。
      
  shipped:
    trigger: fulfillment_created
    template: shipping_update
    variables:
      - tracking_number
      - carrier
      - estimated_delivery
      
  out_for_delivery:
    trigger: tracking_status_change
    condition: status == "out_for_delivery"
    message: |
      🚚 您的訂單正在配送中!
      
      預計今天 {eta} 前送達。
      
      即時追蹤:{tracking_url}
      
  delivered:
    trigger: tracking_status_change
    condition: status == "delivered"
    message: |
      📦 您的訂單已送達!
      
      希望您喜歡!
      
      [留下評價]({review_url})
      [需要協助?]({support_url})

預約提醒

appointment_reminders:
  schedule:
    - 24_hours_before
    - 1_hour_before
    
  template: appointment_reminder
  
  24h_message: |
    📅 *預約提醒*
    
    嗨 {name},
    
    您明天有一個預約:
    
    📍 {location}
    🕐 {time}
    👤 {provider}
    
    回覆:
    ✅ CONFIRM 確認
    ❌ CANCEL 取消
    📅 RESCHEDULE 更改時間
    
  1h_message: |
    ⏰ 您的預約將在 1 小時後開始!
    
    {provider} 在 {location}
    
    待會見!

廣播訊息

活動管理

broadcast_campaigns:
  setup:
    - import_contacts: from_crm
    - segment_audience: by_criteria
    - create_template: get_approval
    - schedule_send
    
  targeting_options:
    - all_contacts
    - by_tag: [vip, new_customer, inactive]
    - by_purchase_history
    - by_location
    - custom_segment
    
  compliance:
    - opt_in_required: true
    - opt_out_easy: reply_STOP
    - frequency_limits: per_contact_per_day
    - quiet_hours: respect_timezone
    
  tracking:
    - delivered
    - read
    - replied
    - clicked_link
    - opted_out

活動模板

campaign_templates:
  promotional:
    template: |
      🎉 *專屬優惠!*
      
      嗨 {name},
      
      {offer_description}
      
      使用優惠碼:{promo_code}
      有效期限:{expiry}
      
      [立即購買]({url})
      
      回覆 STOP 取消訂閱
      
  product_launch:
    template: |
      🚀 *新品到貨通知*
      
      {name},快來看看我們的最新商品:
      
      {product_name}
      {product_description}
      
      {price}
      
      [查看商品]({url})
      
  reengagement:
    template: |
      👋 *我們想念您,{name}!*
      
      距離您上次光臨已經有一段時間了。
      
      這是給您的 15% 折扣,歡迎回來:
      
      優惠碼:COMEBACK15
      
      [立即購買]({url})

n8n 整合

工作流程範例

workflow: "WhatsApp 訂單機器人"

nodes:
  - name: "WhatsApp 觸發器"
    type: "n8n-nodes-base.whatsAppTrigger"
    parameters:
      events: ["messages"]
      
  - name: "解析訊息"
    type: "n8n-nodes-base.code"
    parameters:
      code: |
        const message = $input.first().json;
        return {
          from: message.from,
          text: message.text.body,
          type: message.type
        };
        
  - name: "AI 回覆"
    type: "n8n-nodes-base.openAi"
    parameters:
      model: "gpt-4"
      messages: [
        { role: "system", content: "..." },
        { role: "user", content: "{{ $json.text }}" }
      ]
      
  - name: "發送回覆"
    type: "n8n-nodes-base.whatsApp"
    parameters:
      operation: "sendMessage"
      phoneNumberId: "{{ $env.WHATSAPP_PHONE_ID }}"
      recipientPhoneNumber: "{{ $json.from }}"
      message: "{{ $json.response }}"

輸出範例

請求:"建立 WhatsApp 訂單通知流程"

輸出

# WhatsApp 訂單通知

## 訊息模板(需 Meta 審核)

### 1. 訂單確認

嗨 {{1}}!🎉

您的訂單 #{{2}} 已確認!

商品:{{3}}
總計:{{4}}

出貨時我們會通知您。

追蹤訂單


### 2. 出貨更新

📦 您的訂單已出貨!

訂單: #{{1}}
貨運業者:{{2}}
追蹤編號:{{3}}

預計送達:{{4}}

追蹤包裹


### 3. 已送達

✅ 已送達!

您的訂單 #{{1}} 已送達。

喜歡嗎?留下評價!
需要協助?回覆此訊息。

評價


## n8n 工作流程

```yaml
trigger: Shopify 訂單建立
steps:
  1. 取得客戶電話
  2. 格式化訂單詳細資訊
  3. 發送 WhatsApp 模板
  4. 記錄到 CRM

自動化規則

  • 訂單成立 → 確認通知(立即)
  • 已出貨 → 追蹤資訊(立即)
  • 配送中 → 提醒(立即)
  • 已送達 → 評價邀請(1 天後)

---

*WhatsApp 自動化技能 - Claude Office Skills 的一部分*