Integrazioni

n8n

Costruisci un workflow Thunderbit no-code con i nodi HTTP Request + Webhook

n8n è il runner di automazione open-source che la maggior parte degli sviluppatori sceglie. Bastano due nodi integrati: HTTP Request per inviare un job, Webhook per intercettare la callback.

URL singolo — /distill

  1. Aggiungi un nodo HTTP Request
  2. Method: POST · URL: https://openapi.thunderbit.com/openapi/v1/distill
  3. Authentication: Header Auth → Authorization: Bearer YOUR_API_KEY
  4. Body (JSON):
{
  "url": "{{ $json.url }}",
  "renderMode": "basic"
}
  1. Il nodo successivo riceve {{ $json.data.markdown }}. Mandalo a Notion, Slack, OpenAI, ecc.

Batch — /batch/distill + Webhook callback

I job asincroni sono il pattern giusto oltre i 5-10 URL. Due workflow:

Workflow A: Submitter

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

Workflow B: Receiver

  • Nodo Webhook, path thunderbit
  • Verifica l'Header X-Thunderbit-Signature rispetto al tuo secret (nodo Function, HMAC-SHA256)
  • Itera {{ $json.results }} → scrivi ogni markdown nel tuo sink

Suggerimenti

  • Usa il nodo Wait di n8n + un HTTP Request di polling su /batch/{jobId} se non puoi esporre un Webhook pubblico
  • Imposta Continue On Fail sul nodo HTTP Request così un singolo 4xx non uccide il workflow

Correlati