---
title: "Turn One Blog Post into 10 Social Posts with n8n + AI"
description: "Build an n8n content-repurposing pipeline that turns any blog URL into LinkedIn, X, and Instagram drafts — AI credits included, no API keys needed."
canonical: https://agentroost.app/en/blog/repurpose-content-social-n8n-ai
date: 2026-06-06T04:00:00Z
---

[Canonical URL](https://agentroost.app/en/blog/repurpose-content-social-n8n-ai)

## The Repurposing Problem

You publish a 1,500-word article, share the link once on LinkedIn, and then it disappears into the archive. Meanwhile, the same ideas — broken into a hook-driven thread, a punchy carousel caption, or a brief X post — could drive traffic for an entire week. The bottleneck isn't ideas; it's the manual labour of rewriting the same content four or five different ways for four or five different audiences.

A well-built n8n workflow collapses that gap. You drop in a URL, the workflow fetches the post, an AI node rewrites it in three distinct platform voices, and optional scheduling nodes queue each piece for the right time. This guide walks through exactly how to build it.

---

## What the Finished Workflow Does

1. Accepts a blog post URL (manually, via webhook, or on a schedule).
2. Fetches and strips the article body down to clean text.
3. Sends the text to an AI/LLM node with three separate prompts — one per platform.
4. Outputs a structured JSON object with `linkedin`, `twitter`, and `instagram` fields.
5. Optionally writes the drafts to a Google Sheet, sends them to a Slack channel, or calls a scheduling API.

Total nodes: roughly 8–10. Build time: under 30 minutes if you follow these steps.

---

## Step-by-Step Build

### Step 1 — Trigger: How the workflow receives a URL

For an always-on pipeline, use a **Webhook** node. Set the HTTP method to `POST` and note the generated URL — you'll call it from your CMS or a browser bookmarklet.

For a batch run over existing posts, a **Schedule Trigger** node + a **Google Sheets** node (reading a column of URLs) works cleanly.

For ad-hoc testing, start with **Manual Trigger** and hardcode the URL in a **Set** node:

```json
{
  "url": "https://yourblog.com/posts/your-article-slug"
}
```

### Step 2 — Fetch the page: HTTP Request node

Add an **HTTP Request** node:

- **Method**: GET
- **URL**: `{{ $json.url }}`
- **Response Format**: Text

The response body will contain full HTML. You do not need to clean it yet — the AI prompt will handle noise, but it helps to strip obvious boilerplate.

### Step 3 — Strip HTML to plain text: Code node

Add a **Code** node (JavaScript) to remove tags and collapse whitespace:

```js
const html = $input.first().json.data;
const text = html
  .replace(/<script[\s\S]*?<\/script>/gi, '')
  .replace(/<style[\s\S]*?<\/style>/gi, '')
  .replace(/<[^>]+>/g, ' ')
  .replace(/\s{2,}/g, ' ')
  .trim();

// Cap at ~3000 chars to stay within token budget
return [{ json: { bodyText: text.slice(0, 3000) } }];
```

### Step 4 — Generate all three platform drafts: AI/LLM node

This is the core step. Add an **AI/LLM** (or **OpenAI Chat Model**) node. In the system prompt, instruct the model to return structured JSON so you can parse each platform's copy cleanly downstream:

**System prompt:**
```
You are a social media copywriter. Given a blog post body, produce platform-native copy for three channels.

Return ONLY valid JSON with these keys:
- "linkedin": a 150-200 word professional post. Lead with a bold insight. End with a question or CTA.
- "twitter": a thread of 4 tweets. Each tweet is under 280 characters. Array of strings.
- "instagram": a 80-120 word caption. Punchy first line. 5 relevant hashtags at the end.

No markdown formatting inside the JSON values. No code blocks. Just the raw JSON object.
```

**User message:**
```
{{ $json.bodyText }}
```

Set temperature to around `0.7` for creative variation. Model choice is up to you — GPT-4o-mini is fast and cheap for drafts; a larger model is worth it for high-stakes posts.

### Step 5 — Parse the JSON response: Code node

The AI node returns a string. Parse it:

```js
const raw = $input.first().json.message.content;
const parsed = JSON.parse(raw);
return [{ json: parsed }];
```

If parsing fails (the model occasionally wraps the JSON in a code fence), add a quick strip:

```js
const clean = raw.replace(/^```json\n?/, '').replace(/\n?```$/, '');
```

### Step 6 — Route to destinations: IF or Switch node

From the parsed object, you can fan out via **IF** or **Switch** to:

- **Google Sheets** — write each platform's copy to its own column for review before publishing.
- **Slack** — post all three drafts to a `#content-drafts` channel where your team can approve them.
- **Buffer / Hootsuite API** — schedule them directly via HTTP Request nodes pointed at those APIs.
- **Notion** — create a database entry per post with all three variants as properties.

For most solo operators, the Google Sheets route is the least brittle starting point. Add a column called `approved` and only push rows where that column is `TRUE` to the scheduling API.

### Step 7 — (Optional) Add variation loops

If you want multiple drafts per platform so you can A/B test, wrap the AI node in a **Loop Over Items** node and run it 2–3 times with a slightly different temperature or a different prompt variant each pass. Because the AI credits are a flat part of your subscription on AgentRoost, running the same content through the model three times costs you nothing extra beyond what you already pay.

---

## Pitfalls to Avoid

- **JSON parsing errors**: Always wrap `JSON.parse` in a try/catch and log the raw response. If the model goes off-format, a broken parse will silently fail the run.
- **Token limits on long posts**: The 3,000-character cap in Step 3 is a safety net. For very long articles, summarise first using a second AI node before the platform-copy node.
- **LinkedIn formatting**: LinkedIn does not render markdown. Instruct the model to use plain line breaks, not `**bold**` or `##` headings.
- **Rate limits on scheduling APIs**: If you batch-process a backlog of 50 posts, add a **Wait** node (e.g., 2-second delay) between scheduling API calls.

---

## How to Run This on AgentRoost

Every AgentRoost subscription gives you your **own n8n instance** — your login, your workflows, your data — running 24/7 on a public subdomain (`https://<your-id>.agentroost.app`). You own it. You're not renting time on a shared editor.

The differentiator that matters for this specific workflow: **AI credits are included**. The AI/LLM node ships pre-wired to your included credit balance. You do not set up an OpenAI account, generate an API key, or worry about a per-token bill climbing every time you regenerate a caption. You pick a model from 350+ options, set your prompt, and run.

**Getting started:**

1. Go to [agentroost.app](/en/agents/n8n) and sign up with email, Google, Microsoft, or Discord.
2. Pick the **n8n** framework, name your instance.
3. Your private n8n editor opens at `https://<your-id>.agentroost.app`.
4. Import or build the workflow above. The AI node already has credits — no API key step.
5. Drop in a blog URL and run. Your LinkedIn, X, and Instagram drafts appear in the output panel.

Plans start at $19.99/mo all-in — roughly the cost of a shared hosting plan, but with compute, a working n8n instance, and AI credits bundled. 14-day money-back guarantee, monthly billing, cancel anytime.

[Compare plans and see what's included](/en/pricing)

---

## What a Week of Content Looks Like

Run this workflow once per published post. From a single 1,200-word article you get:

| Day | Platform | Format |
|-----|----------|--------|
| Mon | LinkedIn | Long-form insight post |
| Tue | X | 4-tweet thread |
| Wed | Instagram | Caption + hashtags |
| Thu | LinkedIn | Follow-up question post (second AI draft) |
| Fri | X | Single-tweet pull quote |

Five pieces of original-feeling content. One source. One workflow run. The variation comes from prompt engineering, not from writing five versions by hand.
