Extract structured JSON from web pages via a webhook API with Gaffa

Go to Workflow
0 views
Built by James Mundy James Mundy
Created on October 16, 2026

Description

Quick overview
This workflow exposes a secured webhook that accepts a URL and a field schema, then uses Gaffa to load the web page and return structured JSON for the requested fields, with caching support and clear 400/502 error responses.

How it works
Receives a POST request on a webhook endpoint secured with Header Auth.
Validates the JSON body (url, optional selector, and a non-empty fields schema with supported types) and returns HTTP 400 with an error message if validation fails.
Builds a Gaffa parse_json extraction request, including a configurable max_cache_age to allow cached results.
Sends the request to Gaffa to render the page and extract the requested fields into structured JSON.
Returns HTTP 200 with the extracted data and a from_cache flag when extraction succeeds, or HTTP 502 with Gaffa’s error message when it fails.

Setup
Install the community node @gaffa-dev/n8n-nodes-gaffa in your n8n instance.
Create a Gaffa account, generate an API key, and add it in n8n as a Gaffa API credential.
Create a Header Auth credential (for example, X-API-Key) and select it on the webhook so callers must include the secret header.
Deploy the workflow and configure your client to POST JSON to the production webhook URL with Content-Type: application/json, including url, fields, and optional selector.

This workflow was created by James Mundy and shared publicly on the n8n community template library. n8nFind indexes it for discovery — the workflow remains the property of its original creator.

Nodes Used (1)

Code
n8n-nodes-base.code