r/n8n 2026 线程充满了交付文章到社交帖子工作流程的工程师,通常花费 20 多个小时将它们连接在一起。本教程通过使用 Scavio 作为单一研究后端,将时间缩短为 90 分钟:竞争对手角度、Reddit 讨论引用和 YouTube 内容挖掘全部输入到一个 n8n 工作流程中,该工作流程输出经过平台调整的帖子。
前置条件
- n8n 自托管或云
- Scavio API 密钥
- 法学硕士证书(OpenAI、Anthropic 或 Together)
操作指南
步骤 1: 创建新的 n8n 工作流程
从接受文章 URL 的 Webhook 或手动触发器开始。
JSON
// n8n Webhook node output
{ "article_url": "https://your-blog.com/post" }步骤 2: 为 Scavio SERP 添加 HTTP 请求节点
研究竞争对手也采用相同的主题。
Bash
// HTTP Request node
POST https://api.scavio.dev/api/v1/search
Headers: x-api-key: {{ $credentials.scavio }}
Body: { "query": "{{ $json.article_title }} competing perspective" }步骤 3: 添加 Scavio Reddit 节点
从有关同一主题的 Reddit 讨论中直接引用。
Bash
POST https://api.scavio.dev/api/v1/search
Body: { "platform": "reddit", "query": "{{ $json.topic }}" }步骤 4: 添加LLM节点以生成平台帖子
提示法学硕士利用研究成果编写 LinkedIn、X 和 Reddit 变体。
Text
// LLM prompt template
You are a social media editor.
Source article: {{ $json.article_text }}
Competitor takes: {{ $json.serp_results }}
Reddit quotes: {{ $json.reddit_results }}
Produce:
1. LinkedIn post (180 words, professional tone)
2. X thread (5 tweets)
3. Reddit comment draft (no self-promo)步骤 5: 扇出到分发节点
将每个平台输出发送到 LinkedIn、X、Buffer 或评论 Slack 通道。
JSON
// Slack node output for review
{ "channel": "#social-drafts", "text": "{{ $json.linkedin_post }}\n\n{{ $json.x_thread }}" }Python 示例
Python
# Equivalent Python runner without n8n:
import os
from scavio import Scavio
from openai import OpenAI
scavio = Scavio(api_key=os.environ['SCAVIO_API_KEY'])
llm = OpenAI()
def article_to_social(article_text: str, topic: str):
serp = scavio.search(query=f'{topic} competing perspective')
reddit = scavio.search(platform='reddit', query=topic)
prompt = f'Source: {article_text}\nSERP: {serp}\nReddit: {reddit}\n\nWrite LinkedIn, X, Reddit variants.'
return llm.chat.completions.create(model='gpt-4', messages=[{'role': 'user', 'content': prompt}]).choices[0].message.contentJavaScript 示例
JavaScript
import { Scavio } from 'scavio';
const scavio = new Scavio({ apiKey: process.env.SCAVIO_API_KEY });
export async function articleToSocial(articleText, topic) {
const [serp, reddit] = await Promise.all([
scavio.search({ query: `${topic} competing perspective` }),
scavio.search({ platform: 'reddit', query: topic })
]);
return { serp, reddit };
}预期输出
JSON
A single article generates 3 platform-tuned posts in under 2 minutes. Typical cost: 2 Scavio calls (~60 credits) + LLM tokens per article.