Skip to content

架構總覽

┌─────────────────────────┐
│ Genesys Cloud │ ← Frank 既有電話系統(企業版)
│ - Webhook(來電) │
│ - Recording API(錄音) │
└──────┬──────────────┬───┘
│ │
│ 接電話即時 │ 通話結束後撈
▼ ▼
┌────────────────┐ ┌────────────────────────┐
│ Screen Pop │ │ P2-A Workflow (n8n) │
│ app.tiwise. │ │ 下載音檔 → GCS │
│ com.tw │ │ HubSpot 建 pending Call│
└────────────────┘ └────────┬───────────────┘
│ │
│ 客戶資料彈跳 │ 雙軌音檔
│ ▼
│ ┌────────────────────────┐
│ │ Google Cloud Storage │
│ │ frank-recordings- │
│ │ tiwise │
│ └────────┬───────────────┘
│ │ P2-B 撈 pending
│ ▼
│ ┌────────────────────────┐
│ │ GCP VM (e2-small) │
│ │ /transcribe endpoint │
│ │ ffmpeg 切片 + Whisper │
│ │ 並行轉錄 │
│ └────────┬───────────────┘
│ │ transcript_raw
│ ▼
│ ┌────────────────────────┐
│ │ P2-C Workflow (n8n) │
│ │ OpenAI GPT 摘要 │
│ │ → HubSpot Call 更新 │
│ │ → HubSpot Contact 更新│
│ └────────┬───────────────┘
▼ ▼
┌─────────────────────────────────────────────┐
│ HubSpot CRM (Starter) │
│ 業務介面:看 Contact + Call 完整 AI 摘要 │
└─────────────────────────────────────────────┘

系統每天分 4 個時段跑批次,三段錯開避免互相卡住:

階段每日觸發時間任務預期耗時
P2-A09:00 / 13:00 / 17:00 / 21:00從 Genesys 撈過去 25 小時通話、下載雙軌音檔、上傳 GCS、HubSpot 建 pending Call約 5 分鐘
P2-B09:30 / 13:30 / 17:30 / 21:30撈所有 pending Call、呼叫 VM /transcribe、寫 transcript_raw約 30 分鐘
P2-C10:00 / 14:00 / 18:00 / 22:00撈所有 transcribed Call、OpenAI 摘要、寫回 Call/Contact約 10 分鐘
Error Notifier隨時任一 workflow 失敗 → Email / LINE 通知

三段每輪間隔約 4 小時。通話結束後,最快在當天下一輪(約 4 小時內)就會看到 AI 摘要,最晚隔天早上補齊。

為什麼是定時批次(每天 4 輪)?

Section titled “為什麼是定時批次(每天 4 輪)?”

n8n Cloud Starter plan 限制 2,500 executions / 月。

Cron 設定月用量是否安全
每 5 分鐘|3 workflows25,920 / 月❌ 超 10 倍
每小時|3 workflows2,160 / 月⚠️ 86% 滿
每天 4 輪|3 workflows360 / 月✅ 用 14.4%

每天 4 輪在「即時性」與「成本」間取得平衡——比每天一次大幅縮短業務看到摘要的等待時間,又離 quota 上限還有充足空間,通話從 30 / 天擴到 100 / 天都不會撞牆。

P2-A 撈到通話 → pending
P2-B 撈到 pending → transcribing → 呼叫 /transcribe → transcribed
P2-C 撈到 transcribed → summarizing → OpenAI → summarized
業務在 HubSpot 看到完整摘要

業務在 HubSpot Call 上改 transcribe_status

改成效果
pending下一輪 P2-B 重新轉錄(適合 recording not ready 的狀況)
transcribed下一輪 P2-C 重新摘要(適合 OpenAI 失敗的狀況)

若有緊急 / 當天就要看到摘要的需求,可在 n8n 手動 Execute Workflow(消耗 1 個 execution quota,但即時跑)。

元件位置用途
Screen Pop 服務GCP VM (e2-small, asia-east1)app.tiwise.com.tw 對外服務
Whisper 轉錄服務同上 VM port 8081/transcribe endpoint
HTTPS 憑證Let’s Encrypt2026-07-07 到期(自動續約)
n8n Workflowsn8n Cloud Starter自動化排程
錄音儲存GCS bucket frank-recordings-tiwise雙軌音檔備份
CRMHubSpot Starter業務介面
GitHub Reporoy6732856/frank-screen-pop程式碼版本控管

本文件託管於 Phase 1 系統相同主機(https://app.tiwise.com.tw/docs/),與系統共用基礎設施。Phase 1 結案後可隨時更新。