Skip to main content
Community template Uses AIMarket ResearchAI RAG

Scrape, search and browse the web with a Firecrawl AI agent webhook - n8n workflow template

Turn any prompt into structured web data. Send a POST request with a natural language prompt and an optional JSON schema, and get back clean, structured results scraped from the web by an AI agent powered by Firecrawl. Data Enrichment: Feed company names or URLs from your CRM…

Template by Firecrawl · Original listing (opens in a new tab)

Starts on
Webhook
Nodes
14 nodes
Level
Intermediate
Setup
About 17 min

Workflow preview

How this workflow runs

  1. 1

    Receive Scrape Request

    Starts the workflow when an external service sends an HTTP request to a webhook URL.

  2. 2

    Primary Chat Model

    Provides a language model via OpenRouter as the chat model.

  3. 3

    Fallback Chat Model

    Provides a language model via OpenRouter as the chat model.

  4. 4

    Parser Chat Model

    Provides a language model via OpenRouter as the chat model.

  5. 5

    Format Response to Schema

    Forces the AI output into a structured JSON schema for reliable downstream use.

  6. 6

    /scrape with Firecrawl

    Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.

  7. 7

    /search with Firecrawl

    Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.

  8. 8

    Interact context with Firecrawl

    Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.

  9. 9

    Execute interaction with Firecrawl

    Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.

  10. 10

    Stop interaction with Firecrawl

    Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.

Creator's notes and setup

Written by Firecrawl for the original listing.

Turn any prompt into structured web data. Send a POST request with a natural language prompt and an optional JSON schema, and get back clean, structured results scraped from the web by an AI agent powered by Firecrawl.

Use Cases

  • Data Enrichment: Feed company names or URLs from your CRM and get back structured firmographic data (industry, funding, team size, tech stack).
  • Lead Generation: Ask the agent to find pricing, contact pages, or product details for a list of competitors.
  • Market Research: Extract structured pricing plans, feature comparisons, or product catalogs from any website.
  • Content Aggregation: Pull structured news, events, or job postings from across the web on a schedule.
  • Sales Intelligence: Enrich prospect lists with company info, recent news, or tech stack details before outreach.

How It Works

POST /webhook/scrape-agent
  1. Receive Scrape Request receives a POST request with prompt and an optional output_schema.

  2. Validate Output Schema checks the schema. If none is provided, it falls back to a permissive default. If the schema is malformed, it returns a clear error via Return Schema Error.

  3. Research & Extract Web Data takes the prompt and uses the full Firecrawl toolkit to research the web:

    • Search (/search): Finds relevant pages and sources across the web.
    • Scrape (/scrape): Extracts clean, structured content from any URL.
    • Interact (interactContext, interact, interactStop): Lets the agent interact with scraped pages in a live session. After scraping a page, the agent can click buttons, fill forms, navigate dynamic content, and extract data that static scraping cannot reach, all without managing sessions manually.

    This combination gives the AI agent complete web navigation capabilities. It can discover sources, read pages, and interact with dynamic content autonomously.

  4. Format Response to Schema (Structured Output Parser) formats the agent's response to match the provided (or default) schema.

  5. Return Structured Results sends the structured JSON back to the caller.

Setup Requirements

  • Firecrawl API Key: Sign up at firecrawl.dev and grab your API key. Connect it in the Firecrawl credential nodes.
  • LLM Provider: Configure your Primary Chat Model and Fallback Chat Model nodes (e.g., OpenRouter, OpenAI, Anthropic). The template uses two model nodes for reliability, plus a separate Parser Chat Model for the output parser.
  • n8n Instance: Self-hosted or cloud. Make sure the webhook node is set to accept POST requests.

API Reference

Endpoint

POST https://your-n8n-instance/webhook/scrape-agent

Request Body

FieldTypeRequiredDescription
promptstringYesNatural language instruction for the agent
output_schemaobjectNoJSON Schema defining the desired output structure

Response

Returns a JSON object matching the provided schema, or a flexible object if no schema was given.


Testing Examples

1. Basic Request (No Schema)

The agent decides the output structure on its own.

curl -X POST "https://your-n8n-instance/webhook/scrape-agent" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Find the latest pricing for Firecrawl"
  }' | jq

Expected output: A JSON object with whatever structure the agent finds most appropriate for the data. Since no schema was provided, the internal default ({ "type": "object", "additionalProperties": true }) is used.

2. Request With a Custom Schema

You define exactly the shape of data you want back.

curl -X POST "https://your-n8n-instance/webhook/scrape-agent" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Find the latest pricing for Firecrawl",
    "output_schema": {
      "type": "object",
      "properties": {
        "source": { "type": "string" },
        "plans": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "price": { "type": "string" },
              "credits": { "type": "string" },
              "highlights": {
                "type": "array",
                "items": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }' | jq

Expected output:

{
  "output": {
    "source": "https://www.firecrawl.dev/pricing",
    "plans": [
      {
        "name": "Free",
        "price": "$0 (one-time)",
        "credits": "500 credits (one-time)",
        "highlights": [
          "Scrape up to 500 pages",
          "2 concurrent requests",
          "Low rate limits",
          "No credit card required"
        ]
      },
      {
        "name": "Hobby",
        "price": "$16/month (billed yearly, save $38)",
        "credits": "3,000 credits / month",
        "highlights": [
          "Scrape up to 3,000 pages",
          "5 concurrent requests",
          "Basic support",
          "$9 per extra 1k credits"
        ]
      }
    ]
  }
}

3. Invalid Schema (String Instead of Object)

curl -X POST "https://your-n8n-instance/webhook/scrape-agent" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Find the latest pricing for Firecrawl",
    "output_schema": "not a valid schema"
  }' | jq

Expected output:

{
  "error": true,
  "message": "Invalid output_schema: must be a JSON object with a valid 'type' property (object, array, string, number, boolean)",
  "example_schema": {
    "type": "object",
    "properties": {
      "name": { "type": "string" },
      "price": { "type": "number" }
    }
  }
}

4. Invalid Schema (Array Instead of Object)

curl -X POST "https://your-n8n-instance/webhook/scrape-agent" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Find the latest pricing for Firecrawl",
    "output_schema": [1, 2, 3]
  }' | jq

Expected output: Same error response as above.

5. Invalid Schema (Missing type Property)

curl -X POST "https://your-n8n-instance/webhook/scrape-agent" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Find the latest pricing for Firecrawl",
    "output_schema": {
      "properties": {
        "name": { "type": "string" }
      }
    }
  }' | jq

Expected output: Same error response as above.

6. Invalid Schema (Invalid type Value)

curl -X POST "https://your-n8n-instance/webhook/scrape-agent" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Find the latest pricing for Firecrawl",
    "output_schema": {
      "type": "banana"
    }
  }' | jq

Expected output: Same error response as above.


Workflow Architecture

Receive Scrape Request (POST)
  |
  v
Validate Output Schema
  |--- Error --> Return Schema Error (error JSON)
  |--- Success --> Research & Extract Web Data (AI Agent)
                     |
                     |--- Primary Chat Model
                     |--- Fallback Chat Model
                     |--- Search & Scrape:
                     |      - /search with Firecrawl
                     |      - /scrape with Firecrawl
                     |--- Interact Tool:
                     |      - Interact context with Firecrawl
                     |      - Execute interaction with Firecrawl
                     |      - Stop interaction with Firecrawl
                     |
                     v
                   Return Structured Results
                     |
                     |--- Format Response to Schema (Output Parser)
                            |
                            |--- Parser Chat Model

Schema Validation Logic

The Validate Output Schema node runs this validation before passing data to the agent:

  • If output_schema is missing or null, the default permissive schema is used: { "type": "object", "additionalProperties": true }.
  • If output_schema is present, it must be a JSON object (not a string, array, or primitive).
  • It must have a type property with a valid value: object, array, string, number, or boolean.
  • If validation fails, the workflow returns an error response with a helpful message and example schema.

Notes

  • The Format Response to Schema node (Structured Output Parser) requires the schema to be passed as a JSON string. The expression {{ JSON.stringify($('Validate Output Schema').item.json.output_schema) }} handles this conversion.
  • The agent has access to Firecrawl's full toolkit: search, scrape, and interact. With all three connected, the agent has complete web navigation powers. It can discover sources via search, extract content via scrape, and interact with dynamic JavaScript-heavy pages via interact. The interact tools let the agent scrape a page first and then continue working with it in a live session, clicking buttons, filling forms, and navigating deeper, all without manual session management. The agent autonomously decides which tools to use based on the prompt.
  • Response times vary depending on the complexity of the prompt and how many pages the agent needs to visit. Simple lookups take a few seconds; deep research can take longer.

n8n nodes used (6 types)

What every node does (14)
  • Receive Scrape Request (Webhook)Starts the workflow when an external service sends an HTTP request to a webhook URL.
  • Validate Output Schema (Code)Runs custom JavaScript to transform or manipulate the data flowing through the workflow.
  • Return Schema Error (Respond To Webhook)Sends the workflow's response back to the caller of the webhook.
  • Research & Extract Web Data (Agent)The AI agent that orchestrates the workflow — it reasons over the input and decides which tools to call.
  • Return Structured Results (Respond To Webhook)Sends the workflow's response back to the caller of the webhook.
  • Primary Chat Model (LLM Chat Open Router)Provides a language model via OpenRouter as the chat model.
  • Fallback Chat Model (LLM Chat Open Router)Provides a language model via OpenRouter as the chat model.
  • Parser Chat Model (LLM Chat Open Router)Provides a language model via OpenRouter as the chat model.
  • Format Response to Schema (Output Parser Structured)Forces the AI output into a structured JSON schema for reliable downstream use.
  • /scrape with Firecrawl (Firecrawl Tool)Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.
  • /search with Firecrawl (Firecrawl Tool)Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.
  • Interact context with Firecrawl (Firecrawl Tool)Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.
  • Execute interaction with Firecrawl (Firecrawl Tool)Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.
  • Stop interaction with Firecrawl (Firecrawl Tool)Lets the AI agent scrape and crawl web pages via Firecrawl as a tool.

FAQ

Scrape, search and browse the web with a Firecrawl AI agent webhook: questions

How do I import the "Scrape, search and browse the web with a Firecrawl AI agent webhook" workflow into n8n?

Copy the workflow JSON from this page, open the n8n editor, click on an empty canvas and paste with Ctrl+V (Cmd+V on macOS). You can also download the .json file and choose Import from File in the workflow menu. Save the workflow, then attach credentials before activating it.

Which nodes and credentials does "Scrape, search and browse the web with a Firecrawl AI agent webhook" use?

It uses Webhook, Respond To Webhook, Code, Agent, Output Parser Structured and LLM Chat Open Router. Any node that connects to an external service needs your own credential — open each node after import and select or create one. Trigger, logic and transformation nodes usually need no credentials.

Can it run on n8n Cloud and on self-hosted n8n?

The workflow format is the same on both. If a node appears as unknown or outdated after import, update n8n to a recent version or, on self-hosted instances, install the required community node package. Features such as $env access are available on self-hosted instances only.

How can I customise "Scrape, search and browse the web with a Firecrawl AI agent webhook"?

Start by changing the trigger (schedule, webhook or app event) and the destination nodes to match your stack — it is listed under Market Research, AI RAG. Edit prompts, field mappings and filters in the relevant nodes, use expressions like {{ $json.field }} to map data, and test with a manual execution before activating.

n8n is a trademark of n8n GmbH. AltFTool is not affiliated with, endorsed by or sponsored by n8n. Community templates are credited to their creators and link to the original listing; AltFTool originals are written and tested by the AltFTool team.

About this page

Free n8n workflow templates to copy and import

The AltFTool n8n library collects free n8n workflow templates for AI agents, Gmail, Google Sheets, Telegram and other apps. Each workflow page shows a preview, the list of nodes and the credentials it needs, and lets you copy or download the JSON to import into your own n8n.

Search the templates by app or task, or browse them by category and by node. The Workflow Inspector checks any workflow JSON for triggers, credentials and hardcoded keys before you share it, and the expressions cheat sheet gives copy-paste n8n expression examples. AltFTool is not affiliated with n8n.

People also search for

  • n8n workflow templates
  • n8n templates
  • n8n automation examples
  • n8n json workflows
  • n8n nodes
  • free n8n workflow templates
  • n8n ai agent template
  • n8n expressions cheat sheet