AutomationFlowsAI & RAG › Linkedin Content Using Viral Post Analysis with Gemini & Image Generation

Linkedin Content Using Viral Post Analysis with Gemini & Image Generation

ByRoshan Ramani @rawsun007 on n8n.io

Content creators, social media managers, marketing agencies, and LinkedIn growth hackers who want to automate their content strategy by analyzing viral posts and generating original, high-engagement content at scale.

Cron / scheduled trigger★★★★☆ complexityAI-powered20 nodesGoogle Gemini ChatGoogle SheetsHTTP RequestGoogle Sheets TriggerAgentOutput Parser StructuredLinkedIn
AI & RAG Trigger: Cron / scheduled Nodes: 20 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7973 — we link there as the canonical source.

This workflow follows the Agent → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "2421d1cb-fd45-4d09-af46-fe7eddb014bc",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -800,
        1648
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "843e69c0-6734-463d-ba79-81eed6350568",
      "name": "LinkedIn Content Automation Scheduler",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1520,
        144
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "ee8cbee4-5929-409e-9f42-daa15971347d",
      "name": "Fetch LinkedIn Profile URLs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1296,
        144
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "a134c65a-51a8-4ad2-9361-56770428013b",
      "name": "Process Profiles in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1072,
        144
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "baa9d8d0-dbc3-405c-827c-44201e9e1864",
      "name": "Scrape LinkedIn Posts API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -848,
        80
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "200bf2c7-c5b1-499d-bdce-0c13c0f1018c",
      "name": "Rate Limiting Delay",
      "type": "n8n-nodes-base.wait",
      "position": [
        -624,
        80
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "beec62a4-f99e-489e-ab2f-3102999e5853",
      "name": "Filter High-Engagement Posts",
      "type": "n8n-nodes-base.filter",
      "position": [
        -400,
        80
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "eaa2f9f9-462f-4838-a5ca-69fa6be91614",
      "name": "Save Viral Posts to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -176,
        144
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "5a5a5e59-e3ad-4c78-9296-495c90a00ad7",
      "name": "New Post Data Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1456,
        1456
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "de36c1f0-e0d9-4613-8853-f7778ec3125d",
      "name": "Filter Recent Posts (3 Days)",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1232,
        1456
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d29253cd-e744-4f41-90c4-07d4c7b101da",
      "name": "Aggregate Trending Content",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1008,
        1456
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5b66d4ed-93c5-487f-b421-4988efb6f765",
      "name": "LinkedIn Content Strategy AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -784,
        1456
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "5a5bec30-5bf1-4f0b-b925-7b5d482dd455",
      "name": "JSON Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -640,
        1680
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "72e67a9d-7f68-4f12-ae37-f568e9cc8a28",
      "name": "Generate Post Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -432,
        1456
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "ced01e5e-bb88-4eeb-86e0-df7d20725872",
      "name": "Download Generated Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -208,
        1456
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "7501ca46-93ac-4ce8-a5d3-8d0eb0e2dc4f",
      "name": "Publish to LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        16,
        1456
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3ec614e2-a0c0-4a3e-b189-29417ed8caf1",
      "name": "Extract Analyzed Post URLs",
      "type": "n8n-nodes-base.code",
      "position": [
        224,
        1456
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "129d48d7-7c3b-4ef7-9296-d058d034832b",
      "name": "Mark Posts as Analyzed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        448,
        1456
      ],
      "parameters": {},
      "typeVersion": 4.7
    },
    {
      "id": "009b2c84-7c90-4e76-8ffa-430e63d79853",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2096,
        -320
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2b60af78-4faa-407e-9ade-301328afed03",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        1040
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "JSON Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "LinkedIn Content Strategy AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Post Image": {
      "main": [
        [
          {
            "node": "Download Generated Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish to LinkedIn": {
      "main": [
        [
          {
            "node": "Extract Analyzed Post URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limiting Delay": {
      "main": [
        [
          {
            "node": "Filter High-Engagement Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Post Data Trigger": {
      "main": [
        [
          {
            "node": "Filter Recent Posts (3 Days)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Generated Image": {
      "main": [
        [
          {
            "node": "Publish to LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "LinkedIn Content Strategy AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Scrape LinkedIn Posts API": {
      "main": [
        [
          {
            "node": "Rate Limiting Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Trending Content": {
      "main": [
        [
          {
            "node": "LinkedIn Content Strategy AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Analyzed Post URLs": {
      "main": [
        [
          {
            "node": "Mark Posts as Analyzed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Viral Posts to Sheets": {
      "main": [
        [
          {
            "node": "Process Profiles in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch LinkedIn Profile URLs": {
      "main": [
        [
          {
            "node": "Process Profiles in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Profiles in Batches": {
      "main": [
        [],
        [
          {
            "node": "Scrape LinkedIn Posts API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter High-Engagement Posts": {
      "main": [
        [
          {
            "node": "Save Viral Posts to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Recent Posts (3 Days)": {
      "main": [
        [
          {
            "node": "Aggregate Trending Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn Content Strategy AI": {
      "main": [
        [
          {
            "node": "Generate Post Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn Content Automation Scheduler": {
      "main": [
        [
          {
            "node": "Fetch LinkedIn Profile URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Content creators, social media managers, marketing agencies, and LinkedIn growth hackers who want to automate their content strategy by analyzing viral posts and generating original, high-engagement content at scale.

Source: https://n8n.io/workflows/7973/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow is ideal for: Content creators who want to replicate successful LinkedIn strategies Social media managers monitoring competitor content performance Marketing teams analyzing trending top

Google Gemini Chat, Google Sheets, HTTP Request +5
AI & RAG

This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty

Telegram, Google Sheets Trigger, Agent +26
AI & RAG

This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.

OpenAI Chat, Memory Buffer Window, Output Parser Structured +11
AI & RAG

This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents. ​

Tool Http Request, Agent, HTTP Request +27
AI & RAG

Who Is This For?

Telegram, Google Sheets Trigger, Lm Chat Mistral Cloud +17