GeminiCreativeWritingAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Auto-Generate and Post LinkedIn Carousels with n8n, Gemini AI, and Post Nitro

Input: TechRadar RSS or manual form title/description → Process: Gemini AI filters news and generates carousel copy → Output: Post Nitro PDF + automated LinkedIn post

ExperiencedStepsWorkflowPrompt
Who
LinkedIn operators or creators who need regular professional content and run a self-hosted n8n instance
You get
Automatically fetch tech news daily, have AI select and generate carousel content, then produce a PDF and post it to LinkedIn
You need
n8n · post-nitro · linkedin

Constraints

Requires self-hosted n8n (community nodes are incompatible with n8n Cloud). Prerequisites: 1) Install the Post Nitro community node @postnitro/n8n-nodes-postnitro-ai; 2) Configure three credentials—Google Gemini API (for gemini-2.5-flash), Post Nitro credentials (API key + Template ID + Brand ID), and LinkedIn OAuth2 API. The workflow runs on a Schedule Trigger at 6:00 AM daily, or via a Form Trigger for manual title/description input. The author did not add form input validation, so fields must be filled correctly.

What they did

Template author kshayan091 published a workflow on the n8n template marketplace for automating LinkedIn carousel content creation. The workflow fetches tech news from TechRadar RSS daily, uses Gemini 2.5 Flash to select the most relevant news and generate carousel copy, then generates a PDF carousel via Post Nitro, and finally uploads and publishes it through the LinkedIn API. A manual form trigger is also supported for custom title and description input.

How it went

Author report (author_report): the workflow can run automatically on a daily schedule, generating and publishing LinkedIn carousel content. Form triggering requires correct title and description entry; the author did not add input validation.

Worth knowing

1. Self-hosted n8n only: Post Nitro is a community node and incompatible with n8n Cloud. 2. Hardcoded parameters must be replaced: brandId, templateId, and credential IDs in the template are placeholders or author examples and must be swapped for actual configuration. 3. No input validation: the form trigger does not validate inputs, and incorrect entries may cause downstream node failures. 4. RSS parser is custom: the Parse HTML node's JavaScript is tailored to TechRadar's RSS structure; changing the source requires modifying the parsing logic. 5. Not tested by this site: reproduction=not_tested; actual operation requires verifying API quotas and permissions independently.

n8n workflow template

Structure checked · Not run-tested

Use “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

  • Gemini Flash 2.5 node: connect Google Gemini/PaLM API credentials.
  • ImportSlides embedPost node: connect postNitroApi credentials.
  • Linkedin User URN node: connect linkedInOAuth2Api credentials.
  • Get Upload URL node: connect linkedInOAuth2Api credentials.
  • Upload PDF node: connect linkedInOAuth2Api credentials.
  • Post to LinkedIn node: connect linkedInOAuth2Api credentials.
  • Gemini Generate node: connect Google Gemini/PaLM API credentials.
  • Gemini Generate1 node: connect Google Gemini/PaLM API credentials.

Configuration to replace

  • Source template is n8n public workflow #7733 (~33 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

  1. Trigger the workflow

    The workflow has two start paths: 1. Automatic: Schedule Trigger node set to fire at 6:00 AM daily. 2. Manual: Form Trigger node provides a form with Title and Description fields. Activate the workflow in n8n for the automatic trigger to take effect; for manual triggering, visit the form path and submit correctly filled fields.

  2. Fetch and parse news

    On the automatic path, the TechRadar News node sends an HTTP GET to https://www.techradar.com/feeds.xml to fetch the RSS feed. The Parse HTML node (Code node) runs JavaScript to parse the RSS XML: - Uses regex to extract all <item> tags - Parses title, description, link, pubDate, category, dc:creator, media:content fields - Strips HTML tags and decodes entities - Outputs a structured JSON array to result This code is tailored to the TechRadar RSS format; changing the source requires modifying the parsing logic.

  3. AI selects relevant news

    The Decide which News to Choose node (Basic LLM Chain) connects to the Gemini Flash 2.5 model, feeds it the parsed news list, and has AI pick the single most relevant item. Node parameter: promptType=define, with the prompt text defined directly.

    Execution prompt · Source text。Decide which News to Choose node text parameter (Basic LLM Chain → promptType: define)

    =You are an AI assistant. Your only task is to select the single most relevant news item from the provided news title list.
    
    Relevance criteria (in order of importance):
    1. n8n Automation
    2. AI and Technology News
    3. Personal brand development and motivation
    
    Exclusion rules:
    - Ignore any news about love, relationships, entertainment gossip, or censored/inappropriate topics.
    
    News list (each item has a number and a title):
    ```
    [
    {{ JSON.stringify($json.result.map((item, index) => ({ number: index+1, title: item.title })), null, 2) }}
    ]
    ```
    
    Return format:
    - Return only the number of the most relevant news item.
    - Do not return text, explanations, or anything else. Just a number
    
    Example valid responses:
    ```
    6
    ```
  4. Generate carousel content

    The Get Title and Description node (Code) merges title and description from either automatic or manual input, outputting combinedTitle and combinedDescription. The Gemini Generate node (Google Gemini) uses the gemini-2.5-flash model to generate LinkedIn carousel copy based on the news title and description. Requires strict JSON output with starting_slide, body_slide (1–3 slides), and ending_slide. The Parse LLM Response1 node (Code) cleans any code fences and parses the JSON, extracting the slides array for downstream use.

    Execution prompt · Source text。Gemini Generate node messages.values[0].content parameter

    =You are an AI Agent that generates LinkedIn carousel post content.
    
    IMPORTANT: Return only raw JSON as plain text. Do not call functions, do not use tool calls, do not add extra text.
    
    Your task: Write engaging, professional slide text for a LinkedIn carousel based on the provided title and description.
    
    News Input:
    ```
    Title: {{ $json.combinedTitle }}
    Description: {{ $json.combinedDescription }}
    ```
    
    Carousel Requirements:
    - Exactly 1 `starting_slide` → strong hook, with heading, sub_heading, description, and CTA button.
    - At least 1 `body_slide` → explain key insights or takeaways from the news (you may create 2–3 if relevant).
    - Exactly 1 `ending_slide` → motivational close with sub_heading, heading, description, and CTA button.
    - Keep tone professional, concise, and LinkedIn-appropriate.
    - Do not include irrelevant topics (love, politics, entertainment gossip).
    - Ensure headings are short and catchy; descriptions can be 1–3 sentences.
    - Output must be valid JSON only, matching the schema below.
    
    Response Format:
    ```
    {
    "slides": [
      {
        "type": "starting_slide",
        "sub_heading": "string",
        "heading": "string",
        "description": "string",
        "cta_button": "string"
      },
      {
        "type": "body_slide",
        "heading": "string",
        "description": "string"
      },
      {
        "type": "ending_slide",
        "sub_heading": "string",
        "heading": "string",
        "description": "string",
        "cta_button": "string"
      }
    ]
    }
    ```
  5. Generate PDF and download

    The ImportSlides embedPost node (Post Nitro) receives the slides JSON and calls the importSlides operation to generate a carousel PDF. - Requires brandId and templateId (hardcoded example values in the template; replace with your own Post Nitro credentials) - Output includes a PDF download URL The Download PDF node (HTTP Request) fetches the PDF from the Post Nitro return URL, saving it as binary my.pdf.

  6. Upload PDF to LinkedIn

    The Linkedin User URN node (HTTP Request) retrieves the current user's sub identifier via the LinkedIn API. The Get Upload URL node (HTTP Request) initializes an upload with LinkedIn's document endpoint to obtain an uploadUrl and document URN: - POST https://api.linkedin.com/rest/documents?action=initializeUpload - Header: LinkedIn-Version: 202307 - Body: owner uses urn:li:person:{{sub}} from the previous step The Upload PDF node (HTTP Request) uploads my.pdf via PUT to the obtained uploadUrl: - Header: Content-Type: application/pdf - Body: binary data On success, the document URN will be used in the final post.

  7. Generate copy and publish

    The Gemini Generate1 node (Google Gemini) uses gemini-2.5-flash to generate LinkedIn post body copy from the original title and description. The Post to LinkedIn node (HTTP Request) publishes the final post: - POST https://api.linkedin.com/rest/posts - Headers: LinkedIn-Version: 202408, Content-Type: application/json - Body includes author, commentary (AI-generated copy), visibility=PUBLIC, content.media (title + uploaded document URN), lifecycleState=PUBLISHED After publishing, the post appears on the LinkedIn home feed.

    Execution prompt · Source text。Gemini Generate1 node messages.values[0].content parameter

    =You are an AI Agent that generates LinkedIn post description.
    
    IMPORTANT: Return only raw text.
    
    Your task: Write engaging, professional text for a LinkedIn post based on the provided title and description.
    
    News Input:
    ```
    Title: {{ $('Get Title and Description').item.json.combinedTitle }}
    Description: {{ $('Get Title and Description').item.json.combinedDescription }}
    ```
    
    Example Response Format:
    ```
    🚀 Just launched my first fully automated LinkedIn carousel — created end-to-end by my AI Employee (built in n8n).
    
    No manual editing, no wasted time. The system handles content creation → carousel design → posting all on its own.
    
    ✨ I’m offering to set this up for 5 people free of cost. If you want to automate your content creation and save hours every week, drop a comment below.
    ```

Prompt you can copy

Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are an n8n workflow setup assistant. The user wants to reproduce a template that automatically fetches tech news, generates LinkedIn carousel content, and publishes it. Help the user:
1. Confirm they have a self-hosted n8n instance (community nodes are incompatible with n8n Cloud)
2. Verify the @postnitro/n8n-nodes-postnitro-ai community node is installed
3. Prepare three API credentials: Google Gemini, Post Nitro (API key + Template ID + Brand ID), and LinkedIn OAuth2
4. After importing from the template marketplace, replace all hardcoded credential IDs, brandId, and templateId
5. When testing the form trigger, ensure Title and Description are filled correctly (no input validation exists)
6. Suggest running manually first to verify each node's output, then activate the scheduled trigger

Note: The brandId and templateId in the template are the author's example values and must be replaced with your own Post Nitro configuration.

Check self-hosted environment and credentials before importing; all hardcoded parameters must be replaced

Source

Auto-generate & post LinkedIn carousels with Gemini AI and Post Nitro · kshayan091 · n8n.io · 2025-08-22

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related