Tutorial

How to Add Content Extraction to an n8n LLM Flow

n8n LLM flows often hit articles or threads that need extraction. One Scavio HTTP node turns that into markdown the LLM can use.

n8n LLM flows often need to read article content. Without extraction, the flow either skips the content or chokes the LLM on raw HTML. This tutorial wires Scavio /extract as a single HTTP node.

Prerequisites

  • n8n cloud or self-hosted
  • Scavio API key

Walkthrough

Step 1: Add HTTP Request node before the LLM node

Plain HTTP, no plugin.

Text
# URL: https://api.scavio.dev/api/v1/extract
# Method: POST
# Header: x-api-key: $SCAVIO_API_KEY
# Body: {"url": "{{$json.url}}", "format": "markdown"}

Step 2: Pass markdown to the LLM node

Body becomes the user message.

Text
# In LLM node body, reference {{$node['HTTP Request'].json.markdown}}.

Step 3: Strip boilerplate (optional)

Function node trim if needed.

JavaScript
// Function node:
return [{json: {markdown: $input.first().json.markdown.replace(/(\[(skip to|navigation)\]\(.*?\)|\bcookie\b.*?policy)/gi, '')}}]

Step 4: Add a fallback path

If extract returns empty.

Text
# IF node: if markdown.length < 200, route to Browserbase or notify.

Step 5: Test on representative URLs

Articles, blog posts, Reddit threads.

Text
# Confirm markdown is clean and the LLM produces grounded output.

Python Example

Python
# Per URL: 1 credit = $0.0043. Free 500/mo handles ~15 URLs/day at $0.

JavaScript Example

JavaScript
// Same architecture in n8n's JS code nodes.

Expected Output

JSON
n8n LLM flows now read article content cleanly. Token usage in the LLM node drops sharply versus raw-HTML alternatives.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

n8n cloud or self-hosted. Scavio API key. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

n8n LLM flows often hit articles or threads that need extraction. One Scavio HTTP node turns that into markdown the LLM can use.