{
  "name": "Scrape high-engagement LinkedIn posts and auto-post with Gemini images",
  "nodes": [
    {
      "id": "{{NODE_ID_1}}",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1008,
        1952
      ]
    },
    {
      "id": "{{NODE_ID_2}}",
      "name": "LinkedIn Content Automation Scheduler",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        336,
        1200
      ]
    },
    {
      "id": "{{NODE_ID_3}}",
      "name": "Fetch LinkedIn Profile URLs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        560,
        1200
      ]
    },
    {
      "id": "{{NODE_ID_4}}",
      "name": "Process Profiles in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        784,
        1200
      ]
    },
    {
      "id": "{{NODE_ID_5}}",
      "name": "Scrape LinkedIn Posts API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        1136
      ]
    },
    {
      "id": "{{NODE_ID_6}}",
      "name": "Rate Limiting Delay",
      "type": "n8n-nodes-base.wait",
      "position": [
        1232,
        1136
      ]
    },
    {
      "id": "{{NODE_ID_7}}",
      "name": "Filter High-Engagement Posts",
      "type": "n8n-nodes-base.filter",
      "position": [
        1456,
        1136
      ]
    },
    {
      "id": "{{NODE_ID_8}}",
      "name": "Save Viral Posts to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1680,
        1200
      ]
    },
    {
      "id": "{{NODE_ID_9}}",
      "name": "New Post Data Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        352,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_10}}",
      "name": "Filter Recent Posts (3 Days)",
      "type": "n8n-nodes-base.filter",
      "position": [
        576,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_11}}",
      "name": "Aggregate Trending Content",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        800,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_12}}",
      "name": "LinkedIn Content Strategy AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1024,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_13}}",
      "name": "JSON Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1168,
        1984
      ]
    },
    {
      "id": "{{NODE_ID_14}}",
      "name": "Publish to LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1584,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_15}}",
      "name": "Extract Analyzed Post URLs",
      "type": "n8n-nodes-base.code",
      "position": [
        1792,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_16}}",
      "name": "Mark Posts as Analyzed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2016,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_17}}",
      "name": "Generate an image",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1376,
        1760
      ]
    },
    {
      "id": "{{NODE_ID_18}}",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        1264
      ],
      "parameters": {
        "width": 480,
        "height": 640,
        "content": "## LinkedIn Viral Content Automation\n\nThis workflow automates LinkedIn content discovery and creation by scraping high-engagement posts, analyzing trends with AI, and publishing optimized content.\n\n##"
      }
    },
    {
      "id": "{{NODE_ID_19}}",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        1008
      ],
      "parameters": {
        "width": 288,
        "height": null,
        "content": "## Profile Scraping\n\nScheduled trigger runs every 12 hours to fetch LinkedIn profile URLs from Google Sheets and process them in batches of 3 to avoid rate limits."
      }
    },
    {
      "id": "{{NODE_ID_20}}",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        944
      ],
      "parameters": {
        "width": 288,
        "height": null,
        "content": "## Post Extraction\n\nCalls Apify API to scrape recent LinkedIn posts from each profile. Includes 3-second delay between requests to respect API rate limits."
      }
    },
    {
      "id": "{{NODE_ID_21}}",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        944
      ],
      "parameters": {
        "width": 336,
        "height": null,
        "content": "## Engagement Filtering\n\nFilters posts with high engagement (20+ likes, comments, or reposts) and saves viral content to Google Sheets for analysis."
      }
    },
    {
      "id": "{{NODE_ID_22}}",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        1552
      ],
      "parameters": {
        "width": 320,
        "height": null,
        "content": "## Data Monitoring\n\nTriggers when new rows are added to Google Sheets. Filters unprocessed posts from the last 3 days and aggregates data for AI analysis."
      }
    },
    {
      "id": "{{NODE_ID_23}}",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        2128
      ],
      "parameters": {
        "width": 448,
        "height": null,
        "content": "## AI Content Strategy\n\nGoogle Gemini analyzes trending patterns from aggregated posts and generates original LinkedIn content following platform best practices. Outputs structured JSON with title, po"
      }
    },
    {
      "id": "{{NODE_ID_24}}",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        1568
      ],
      "parameters": {
        "width": 288,
        "height": null,
        "content": "## Visual Generation\n\nGenerates professional LinkedIn-optimized images using Google Imagen based on AI-created prompts."
      }
    },
    {
      "id": "{{NODE_ID_25}}",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        1936
      ],
      "parameters": {
        "width": 288,
        "height": null,
        "content": "## Status Tracking\n\nExtracts processed post URLs and marks them as analyzed in Google Sheets to prevent duplicate processing."
      }
    }
  ],
  "connections": {
    "Generate an image": {
      "main": [
        [
          {
            "node": "Publish to LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "LinkedIn Content Strategy AI",
            "type": "ai_outputParser",
            "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
          }
        ]
      ]
    },
    "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 an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn Content Automation Scheduler": {
      "main": [
        [
          {
            "node": "Fetch LinkedIn Profile URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}