Skip to main content

Tutorials / Webhook Integrations / n8n (HTTP Trigger)

n8n (HTTP Trigger)

Receive Lection webhooks with an HTTP Trigger node and fan out to workflows.

Ideal for: Self-hosted automation with code + no-code mix.

Setup Steps

  1. Create a workflow → add HTTP Trigger node (method POST).
  2. Copy the test URL and paste it into Lection’s Webhook URL (optionally set X-Lection-Secret).
  3. Run a test scrape to populate sample data in the node.
  4. Add a Split In Batches or Item Lists loop over dataset.records to insert rows into your destination.
  5. Activate the workflow; Lection will POST for every completed scheduled scrape.

Mapping Tips

  • HTTP Trigger node exposes the JSON in {{$json}}; dataset.records is the array to loop.
  • Check header X-Lection-Secret in an IF node if you set a secret.
  • Use download.url for a file link; status is in run.status.

Payload highlights

  • event: scheduled_scrape.completed; dataset.rowCount + dataset.records payload.
  • Headers include X-Lection-Secret when provided.

Test checklist

  • Set webhook URL and optional secret in Lection.
  • Run a scheduled scrape to capture sample data.
  • Confirm dataset.records and download.url arrive in your tool.
  • Publish/activate the workflow so production runs stay wired.