n8n LLM流程经常需要阅读文章内容。如果不进行提取,流程要么会跳过内容,要么会在原始 HTML 上阻塞 LLM。本教程将 Scavio /extract 连接为单个 HTTP 节点。
前置条件
- n8n 云或自托管
- Scavio API 密钥
操作指南
步骤 1: 在LLM节点之前添加HTTP请求节点
纯 HTTP,无插件。
Text
# URL: https://api.scavio.dev/api/v1/extract
# Method: POST
# Header: x-api-key: $SCAVIO_API_KEY
# Body: {"url": "{{$json.url}}", "format": "markdown"}步骤 2: 将 markdown 传递给 LLM 节点
正文成为用户消息。
Text
# In LLM node body, reference {{$node['HTTP Request'].json.markdown}}.步骤 3: 剥离样板(可选)
如果需要,功能节点修剪。
JavaScript
// Function node:
return [{json: {markdown: $input.first().json.markdown.replace(/(\[(skip to|navigation)\]\(.*?\)|\bcookie\b.*?policy)/gi, '')}}]步骤 4: 添加后备路径
如果提取返回空。
Text
# IF node: if markdown.length < 200, route to Browserbase or notify.步骤 5: 对代表性 URL 进行测试
文章、博客文章、Reddit 主题。
Text
# Confirm markdown is clean and the LLM produces grounded output.Python 示例
Python
# Per URL: 1 credit = $0.0043. Free 250/mo handles ~8 URLs/day at $0.JavaScript 示例
JavaScript
// Same architecture in n8n's JS code nodes.预期输出
JSON
n8n LLM flows now read article content cleanly. Token usage in the LLM node drops sharply versus raw-HTML alternatives.