整合

n8n

用 HTTP Request + Webhook 節點搭一條免寫程式的 Thunderbit workflow

n8n 是大部分開發者第一個會用的開源自動化引擎。兩個內建節點就夠了:HTTP Request 送任務,Webhook 接回呼。

單一 URL —— /distill

  1. 加一個 HTTP Request 節點
  2. Method: POST · URL: https://openapi.thunderbit.com/openapi/v1/distill
  3. 認證:Header Auth → Authorization: Bearer YOUR_API_KEY
  4. Body(JSON):
{
  "url": "{{ $json.url }}",
  "renderMode": "basic"
}
  1. 下一個節點會收到 {{ $json.data.markdown }},接到 Notion、Slack、OpenAI 都行。

批次 —— /batch/distill + Webhook 回呼

URL 數量超過 5-10 個就要走非同步。兩條 workflow:

Workflow A:送任務

  • HTTP Request → POST /openapi/v1/batch/distill
  • Body:
{
  "urls": {{ $json.urls }},
  "callback": {
    "url":    "https://your-n8n.example.com/webhook/thunderbit",
    "secret": "whsec_..."
  }
}

Workflow B:收結果

  • Webhook 節點,路徑 thunderbit
  • 用你的 secret 驗 X-Thunderbit-Signature Header(Function 節點,HMAC-SHA256)
  • 走訪 {{ $json.results }} → 把每個 markdown 寫進你要的目的地

小技巧

  • 沒辦法暴露公開 webhook 時,用 n8n 的 Wait 節點 + 一個輪詢的 HTTP Request/batch/{jobId}
  • HTTP Request 節點打開 Continue On Fail,這樣單次 4xx 不會把整條 workflow 弄掛

相關文件