Turn Articles into LinkedIn Carousel Copy with n8n + OpenAI
Input article URL or text → n8n workflow fetches/parses → OpenAI generates structured carousel JSON → outputs Canva-ready copy with validation
- Who
- Content operators, B2B consultants, social media managers
- You get
- After sending an article via webhook, receive structured LinkedIn carousel copy for an exact slide count (5–10), including headlines, body text, visual direction, Canva layout notes, post caption, hashtags, and alt text
- You need
- n8n
Constraints
Requires: an accessible n8n instance, an OpenAI API credential (type openAiApi), and a client capable of sending POST requests. Accepts articleText/content/text or articleUrl/url; optional language (default es), audience (default B2B content creators and consultants), slideCount (default 8, constrained 5–10). Output is JSON carousel structure plus a plain-text Canva copy block. The workflow does not publish to LinkedIn or create Canva design files.
What they did
Author malkomich published this workflow template (ID 17440) in the n8n official template library. The template receives an article URL or text via webhook, then runs input parsing, conditional routing, optional web fetching, OpenAI generation, JSON formatting, and structural validation, finally returning structured LinkedIn carousel copy and a Canva copy block. The template is marked published on n8n, contains 12 nodes, and includes full node connections.
How it went
No independent runtime effectiveness report is provided by the source; the template page shows official published status without run counts, success rates, or user feedback. The author states the template generates Canva-importable carousel copy and does not auto-publish to LinkedIn. (author_report)
Worth knowing
1. Runtime bug: the JS code in both Prepare Canva Format and Check Carousel Structure references $items('Normalize Input', ...), but the actual node is named 'Parse Input for Processing'. This bug causes runtime failure and must be manually fixed before use. 2. Default language is Spanish (es) and default audience is B2B content creators and consultants; English users should explicitly pass language=en. 3. URL fetching only handles public HTML; anti-bot, authenticated, or heavy client-side rendered pages may return empty content. 4. Output is text/JSON only—no image generation, no auto-publishing to LinkedIn, no Canva design file creation. 5. This site has not tested the workflow; reproduction=not_tested.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- OpenAI Carousel Generator node: connect OpenAI API credentials.
Configuration to replace
- Source template is n8n public workflow #17440 (~12 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Receive webhook request and parse input
Activate the workflow in n8n and copy the production webhook URL. Send a POST to that URL with text/articleText/content or url/articleUrl in the body. The 'Parse Input for Processing' code node normalizes the input: extracts sourceUrl, sourceText, language (default 'es'), audience (default 'Creadores de contenido y consultores B2B'), slideCount (default 8, hard-limited 5–10). Throws an error if neither URL nor text is provided.
Route by input type (URL or plain text)
The 'If URL Provided' node checks whether sourceUrl is non-empty. If empty, proceeds directly with sourceText to generation; if non-empty, enters the fetch branch.
Fetch page and extract article text (URL path)
The 'Fetch Article Content' HTTP Request node requests sourceUrl with a 30-second timeout and returns raw-text HTML. The 'Extract Article Text' code node strips script and style tags, removes HTML tags, converts to spaces and & to &, collapses whitespace, and keeps the first 40,000 characters. Throws an error if the result is empty.
Call OpenAI to generate carousel JSON
The 'OpenAI Carousel Generator' node uses gpt-4o-mini (temperature=0.4, maxTokens=4000) with a system/user message. The prompt instructs the model to return strict JSON (no markdown fences) containing title, source, audience, language, slides array (each with headline ≤60 chars, body ≤220 chars, visual, design_notes), caption, hashtags (≤5), and alt_text. Must produce exactly slideCount slides, with a strong cover as the first slide and an actionable CTA as the last. The language and audience fields must echo the requested values. All claims must be source-supported; no invented facts, statistics, quotes, or citations.
Execution prompt · Source text。OpenAI Carousel Generator node messages.values[0].content field
You are a senior B2B LinkedIn content strategist. Turn the supplied article or long-form text into a practical LinkedIn carousel that can be copied into Canva. Return ONLY valid JSON, with no markdown fences, using exactly this shape: { "title": "string", "source": "url or text", "audience": "string", "language": "string", "slides": [ {"number": 1, "headline": "max 60 chars", "body": "max 220 chars", "visual": "short visual direction", "design_notes": "short Canva layout note"} ], "caption": "LinkedIn post caption with a clear hook and CTA", "hashtags": ["#tag"], "alt_text": "accessible description of the carousel" } Rules: - Produce exactly {{ $json.slideCount }} slides, not a range. The first slide must be a strong cover and the final slide must be an actionable CTA. - Return the exact requested values in the `language` and `audience` fields: language must be `{{ $json.language }}` and audience must be `{{ $json.audience }}`. Do not substitute a display name such as English for the language code. - Extract only claims supported by the source; do not invent facts, statistics, quotes, or citations. - Use concise, specific B2B language for content creators and B2B consultants. - One core idea per slide. Make headlines skimmable and body copy ready to paste into a design. - Use the requested language for all user-facing copy. - Keep hashtags relevant and limited to 5. Requested language: {{ $json.language }} Audience: {{ $json.audience }} Source mode: {{ $json.inputMode }} Source URL: {{ $json.sourceUrl || 'Provided text' }} Source content: {{ $json.sourceText }}Format Canva copy and validate structure
The 'Prepare Canva Format' code node extracts JSON from the OpenAI response by taking the substring from the first '{' to the last '}', then parses it. Validates that slides array exists, slideCount is within 5–10, and the returned count meets or exceeds the request, then slices to the first slideCount slides and renumbers them. Generates a canvaCopy plain-text block (each slide with headline, body, visual, design_notes). The 'Check Carousel Structure' code node re-validates slide count, language, and audience against the request. Any failure throws an error. ⚠️ Note: both nodes internally reference $items('Normalize Input', ...), which points to a non-existent node name (the actual node is 'Parse Input for Processing'). Using the original template as-is will fail at runtime; you must manually correct the node name or rewrite the reference logic.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant to confirm inputs and permissions, then guide import and fixes
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to replicate an 'article → LinkedIn carousel copy' automation. Assist in this order: 1. Confirm the user has an n8n instance (self-hosted or cloud) and an OpenAI API key. 2. Guide them to import workflow template ID 17440 in n8n, or manually create nodes from the provided workflow.json. 3. Emphasize creating an OpenAI API credential (type openAiApi) and selecting it in the OpenAI Carousel Generator node. 4. Remind them to activate the webhook, copy the production URL, and explain the POST body format (text/articleText/content or url/articleUrl, plus optional language/audience/slideCount). 5. Warn: the Prepare Canva Format and Check Carousel Structure nodes reference a non-existent 'Normalize Input' node; they must manually change this to 'Parse Input for Processing' or equivalent data reference, otherwise the workflow will error at runtime. 6. Suggest testing with a short text snippet first, confirming JSON output is valid before production use.
Paste your webhook URL and OpenAI key status; the assistant will guide import and testing
Source
Generate LinkedIn carousels from articles with OpenAI GPT-4o-mini · malkomich · n8n.io · 2026-07-23
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.