ChatGPTCreativeWritingAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Build a Recipe Recommendation Engine with Bright Data MCP & OpenAI

Input a recipe search URL → Bright Data MCP paginated scraping → GPT-4o-mini structured extraction → loop over single pages → output JSON files and Webhook notifications

Some experienceStepsWorkflowPromptTip
Who
Content creators, nutritionists, recipe-aggregator developers, or automation engineers who want to batch-scrape and structure recipe data in n8n using MCP and LLMs.
You get
Automatically convert any public recipe search page into structured JSON (title, URL, category, rating, serves, dietary options, etc.) with pagination traversal, per-page looped scraping, and delivery via Webhook or local file.
You need
n8n · local disk

Constraints

Prerequisites: self-hosted n8n instance (community node MCP Client is self-hosted only); Bright Data account with a Web Unlocker zone; OpenAI account. In n8n, configure a Header Auth credential (Bearer Token = Bright Data Web Unlocker Token) and an OpenAI API credential. After importing the template, update the three fields in the 'Set the Recipe Extract URL' node.

What they did

Author ranjancse published this workflow in the n8n official template library, combining Bright Data's MCP (Model Context Protocol) client with OpenAI GPT-4o-mini to automatically scrape public recipe search pages, traverse pagination, loop through individual pages for structured extraction, and output standard JSON. The 23-node workflow uses LLM Chains for two-stage structured extraction (pagination links + recipe details), Split In Batches for looped processing, and dual output via Webhook and local file.

How it went

The source reports this template solves: automated recipe data extraction from any public URL, AI-driven structured data extraction, scalable looped crawling and processing, and real-time notifications with data persistence. (author_report) The template page shows 597 views and published status.

Worth knowing

1. Self-hosted only: The community node n8n-nodes-mcp.mcpClient requires a self-hosted n8n instance; cloud-hosted instances cannot install it directly. 2. Credential requirements: You need a Bright Data Web Unlocker zone Header Auth Token (Bearer format) and an OpenAI API key; cost details are not specified by the source. 3. Hard-coded path: The 'Write the structured content to disk' node defaults to a Windows path `d:\Recipe-Structured-Data-...`; Linux/macOS users must change this. 4. Wait node: A 10-second Wait node inside the loop controls scraping frequency, but large-scale scraping still requires monitoring Bright Data usage and rate limits. 5. Swappable model: The source suggests GPT-4o-mini can be replaced with Gemini or another provider, and Schema fields can be customized. 6. Swappable storage: The source suggests replacing local disk with S3, GCS, MongoDB, PostgreSQL, Google Sheets, etc. 7. Not tested by this site: reproduction=not_tested; when building, test with a single page first to verify credentials and Schema compatibility.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • List all tools for Bright Data node: connect mcpClientApi credentials.
  • Bright Data MCP Client For Recipe Extract node: connect mcpClientApi credentials.
  • Bright Data MCP Client For Recipe Extract Within The Loop node: connect mcpClientApi credentials.
  • OpenAI Chat Model for Paginated Data Extract node: connect OpenAI API credentials.
  • OpenAI Chat Model for Structured Data Extract node: connect OpenAI API credentials.

Configuration to replace

  • Source template is n8n public workflow #4591 (~23 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-25

Steps

  1. Configure inputs and credentials

    After importing the template into n8n, open the 'Set the Recipe Extract URL' node (Edit Fields/Set) and update three fields: url (target recipe search page, e.g. https://realfood.tesco.com/search.html?search=tomato%20pasta&sortby=Rating), base_url (root of the search page), and webhook_url (your notification endpoint). Also confirm that the Bright Data MCP Client Header Auth credential is set (Value = Bearer + Web Unlocker Token) and the OpenAI API credential is configured.

    Setup guidance · Editorial suggestion。Setup assistant starter; guides user through credential and input configuration

    Please complete the following setup in n8n:
    1. After importing the template, locate the 'Set the Recipe Extract URL' node and set url, base_url, and webhook_url.
    2. In Credentials, configure mcpClientApi: choose Header Auth, and set Value to Bearer YOUR_BRIGHT_DATA_WEB_UNLOCKER_TOKEN.
    3. Configure the openAiApi credential.
    4. Verify that the local path in the 'Write the structured content to disk' node (e.g. d:\Recipe-Structured-Data-{{ $('Loop Over Items').item.json.page_number }}.json) is writable on your system.
  2. Scrape search page and extract paginated links with Bright Data MCP

    Once triggered, the 'Bright Data MCP Client For Recipe Extract' node calls scrape_as_html to fetch the search-page HTML. Then the 'Paginated Data Extract' LLM Chain node invokes GPT-4o-mini, guided by the 'Structured Output Parser for Paginated Data' JSON Schema, to extract an array of pagination links (page_number and link). The system message is "You are an expert data miner".

    Execution prompt · Source text。Paginated Data Extract node text field (LLM Chain user input)

    =Extract the paginated data from the provided content. 
    
    Here's the content : {{ $json.result.content[0].text }}
    
    Append the link with the Base URL as {{ $('Set the Recipe Extract URL').item.json.base_url }}

    Execution prompt · Source text。Paginated Data Extract node messages.messageValues[0].message (system prompt)

    You are an expert data miner

    Execution prompt · Source text。Structured Output Parser for Paginated Data node jsonSchemaExample field

    [{
    	"page_number": "page number in int",
    	"link": "link to the web content"
    }]
  3. Convert output and loop over paginated links

    The 'Code to output the array of paginated info' node runs `return $input.first().json.output` to normalize the LLM parse result into a standard array. Then the 'Loop Over Items' node emits each pagination link individually for downstream processing.

    Execution prompt · Source text。Code to output the array of paginated info node jsCode field

    return $input.first().json.output
  4. Per-page scrape and wait inside the loop

    Each link enters the 'Wait' node (10-second delay), then the 'Bright Data MCP Client For Recipe Extract Within The Loop' node calls scrape_as_html again to fetch the individual recipe-page HTML. The node uses the expression `{{ $json.link }}` to pass the URL dynamically.

    Execution prompt · Source text。Bright Data MCP Client For Recipe Extract Within The Loop node toolParameters field

    ={
       "url": "{{ $json.link }}"
    }
  5. Structured recipe extraction with GPT-4o-mini

    The 'Structured Recipe Data Extract' LLM Chain node calls GPT-4o-mini with the same system message "You are an expert data miner" and user input "=Extract search data. Here's the content : Output the data in JSON". The output is parsed by the 'Structured Output Parser for Recipe Data Extract' against a full JSON Schema into structured fields: pageTitle, searchTerms, sortBy, numberOfResults, numberOfPages, numberOfFirstResult, numberOfLastResult, and a recipes array (title, url, category, rating, serves, dietaryOptions, isHealthy).

    Execution prompt · Source text。Structured Recipe Data Extract node text field (LLM Chain user input)

    =Extract search data. Here's the content : 
    Output the data in JSON

    Execution prompt · Source text。Structured Recipe Data Extract node messages.messageValues[0].message (system prompt)

    You are an expert data miner

    Execution prompt · Source text。Structured Output Parser for Recipe Data Extract node inputSchema field

    {
      "$schema": "http://json-schema.org/schema#",
      "title": "TescoRecipeSearchResults",
      "type": "object",
      "properties": {
        "pageTitle": { "type": "string" },
        "searchTerms": { "type": "string" },
        "sortBy": { "type": "string" },
        "numberOfResults": { "type": "integer" },
        "numberOfPages": { "type": "integer" },
        "numberOfFirstResult": { "type": "integer" },
        "numberOfLastResult": { "type": "integer" },
        "recipes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "title": { "type": "string" },
              "url": { "type": "string" },
              "category": { "type": "string" },
              "rating": { "type": "number" },
              "serves": { "type": "integer" },
              "dietaryOptions": {
                "type": "array",
                "items": { "type": "string" }
              },
              "isHealthy": { "type": "boolean" }
            },
            "required": [
              "title",
              "url",
              "category",
              "rating",
              "serves",
              "dietaryOptions"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "pageTitle",
        "searchTerms",
        "sortBy",
        "numberOfResults",
        "numberOfPages",
        "numberOfFirstResult",
        "numberOfLastResult",
        "recipes"
      ],
      "additionalProperties": false
    }
  6. Webhook push of structured results

    The 'Webhook Notification for Data Extract Within the Loop' node POSTs `{{ $json.output.toJsonString() }}` as the recipe_content field in multipart/form-data format to the configured webhook_url. This can feed Slack, Discord, or internal APIs.

  7. Save JSON to local disk

    The 'Create a binary data' node converts the JSON output to base64 binary, then the 'Write the structured content to disk' node writes it to a local file whose name includes the page number variable: `=d:\Recipe-Structured-Data-{{ $('Loop Over Items').item.json.page_number }}.json`. Adjust the path for your operating system.

    Execution prompt · Source text。Create a binary data node functionCode field

    items[0].binary = {
      data: {
        data: new Buffer(JSON.stringify(items[0].json, null, 2)).toString('base64')
      }
    };
    return items;

Prompt you can copy

Setup guidance · Editorial suggestion。Setup assistant starter; guides user through credential and input configuration

This block is the prompt. Ads are never placed here.

Please complete the following setup in n8n:
1. After importing the template, locate the 'Set the Recipe Extract URL' node and set url, base_url, and webhook_url.
2. In Credentials, configure mcpClientApi: choose Header Auth, and set Value to Bearer YOUR_BRIGHT_DATA_WEB_UNLOCKER_TOKEN.
3. Configure the openAiApi credential.
4. Verify that the local path in the 'Write the structured content to disk' node (e.g. d:\Recipe-Structured-Data-{{ $('Loop Over Items').item.json.page_number }}.json) is writable on your system.

This template is self-hosted n8n only (community MCP Client node restriction). Update url/base_url/webhook_url and the local disk path before testing.

Source

Recipe recommendation engine with Bright Data MCP & OpenAI 4o mini · ranjancse · n8n.io · 2025-06-02

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related