{
  "id": "dIiF7H-c4a4DoV_BYbqbP",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "LinkedIn posts generator",
  "tags": [
    {
      "id": "xRJNyiRIpAsEzL8y",
      "name": "Olostep",
      "createdAt": "2026-01-31T11:17:46.807Z",
      "updatedAt": "2026-01-31T11:17:46.807Z"
    }
  ],
  "nodes": [
    {
      "id": "255db91c-2beb-4cff-a5b8-fd8f7f6ed71a",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        16
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4823840d-61d6-4b5a-b707-c4045c8280d7",
      "name": "get topic",
      "type": "n8n-nodes-base.googleSheets",
      "maxTries": 2,
      "position": [
        224,
        16
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "To-Do",
              "lookupColumn": "status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Kdh2MssIaPMMNTC7HcIZyWhT72s3PrZsozGVfq8P6fM/edit#gid=0",
          "cachedResultName": "topics"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Kdh2MssIaPMMNTC7HcIZyWhT72s3PrZsozGVfq8P6fM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Kdh2MssIaPMMNTC7HcIZyWhT72s3PrZsozGVfq8P6fM/edit?usp=drivesdk",
          "cachedResultName": "LinkedIn Post (n8n)"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.7
    },
    {
      "id": "dfe534ad-d04d-4d6c-b431-e3760eea3aac",
      "name": "Create answer",
      "type": "n8n-nodes-olostep.olostepScrape",
      "maxTries": 2,
      "position": [
        448,
        16
      ],
      "parameters": {
        "task": "=Search the web for {{ $json.topic }}",
        "resource": "answer",
        "json_schema": "{\"current_information\": \"\", \"key_insights\": \"\", \"trends\": \"\", \"statistics\": \"\", \"relevant_context\": \"relevant context that would be valuable for creating an engaging LinkedIn post\"}"
      },
      "credentials": {
        "olostepScrapeApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "1326f32a-7f0e-409b-8102-6597b1463bfe",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        768,
        144
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e313182a-5d9e-471f-a34e-42f178af8e2c",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "maxTries": 2,
      "position": [
        1648,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "post": "={{ $json.output }}",
            "image": "={{ $('image URL').first().json.data.first().url }}",
            "topic": "={{ $('get topic').first().json.topic }}",
            "status": "Done"
          },
          "schema": [
            {
              "id": "topic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "topic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "post",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "image",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "topic"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Kdh2MssIaPMMNTC7HcIZyWhT72s3PrZsozGVfq8P6fM/edit#gid=0",
          "cachedResultName": "topics"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Kdh2MssIaPMMNTC7HcIZyWhT72s3PrZsozGVfq8P6fM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Kdh2MssIaPMMNTC7HcIZyWhT72s3PrZsozGVfq8P6fM/edit?usp=drivesdk",
          "cachedResultName": "LinkedIn Post (n8n)"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.7
    },
    {
      "id": "d8f9d01d-89f7-4256-ba03-2e9b1e58b8f5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 288,
        "content": "## Get Topic\nFetches the next topic marked as \"To-Do\" from Google Sheets."
      },
      "typeVersion": 1
    },
    {
      "id": "06cc4ef7-de28-44fe-b184-ebf8c819338d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 288,
        "height": 288,
        "content": "## Web Research (Olostep)\nSearches the web and extracts insights, trends, and statistics."
      },
      "typeVersion": 1
    },
    {
      "id": "d5fa73ef-70ce-4321-891f-e1629ab8c778",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 352,
        "height": 336,
        "content": "## AI Post Writer\nCreates a professional, engaging LinkedIn post with hashtags and CTA."
      },
      "typeVersion": 1
    },
    {
      "id": "1ee51a9a-a35e-422a-a0c9-c0cf2955e524",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 272,
        "content": "## Image Prompt Generator\nGenerates a short prompt for LinkedIn post visuals."
      },
      "typeVersion": 1
    },
    {
      "id": "66786c92-0ffb-416f-9c15-d5a65ff341e6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 272,
        "content": "## Image Generation\nUses a hugging face model to generate a post image from the prompt."
      },
      "typeVersion": 1
    },
    {
      "id": "7917771d-b21b-4bbd-ab5e-9aeb5bdb1928",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 304,
        "content": "## Update Sheet\nSaves the post and marks the topic as \"Done\", then sends a notification on your email."
      },
      "typeVersion": 1
    },
    {
      "id": "02faf4b1-d8cc-4e5d-97f7-1e4dccbc172b",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1872,
        0
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=Hey Name!\n\nA new LinkedIn post about {{ $('get topic').first().json.topic }} has been generated.\n\nYou can check it out here: https://yourSheetURL.example",
        "options": {},
        "subject": "New LinkedIn Post Generated...",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f140f7b3-52de-429f-992e-6d11b3c6fbfa",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -368
      ],
      "parameters": {
        "color": 3,
        "width": 496,
        "height": 112,
        "content": "## Warning\nSometimes the hugging face gives a null data or even take too long and don't get back with any. In that case consider trying another model or any image generation model that you prefer."
      },
      "typeVersion": 1
    },
    {
      "id": "fc7ee1b2-bb16-4a01-a7d7-d3167901fcb2",
      "name": "Image Prompt Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        672,
        -112
      ],
      "parameters": {
        "text": "=Topic: {{ $('get topic').item.json.topic }}\nCurrent Information: {{ $json.result.current_information }}\nKey Insights: {{ $json.result.key_insights }}\nTrends: {{ $json.result.trends }}\nStatistics: {{ $json.result.statistics }}\nRelevant Context: {{ $json.result.relevant_context }}",
        "options": {
          "systemMessage": "=# System Role  \nYou are an expert image prompt generator for LinkedIn content creation specializing in transforming incoming articles into a prompt for an image generator.  \n\n# Task Specification  \n- Using the provided article, craft a prompt for LinkedIn post image.\n- Do Not output anything but the image prompt. No pre text or post text, No summaries, just the image prompt ready for the generation."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "fa4498e0-60f0-4d28-8f55-1451d13da224",
      "name": "Post Writer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        992,
        208
      ],
      "parameters": {
        "text": "=Topic: {{ $('get topic').item.json.topic }}\nCurrent Information: {{ $json.result.current_information }}\nKey Insights: {{ $json.result.key_insights }}\nTrends: {{ $json.result.trends }}\nStatistics: {{ $json.result.statistics }}\nRelevant Context: {{ $json.result.relevant_context }}",
        "options": {
          "systemMessage": "=# System Role  \nYou are an expert LinkedIn content creator specializing in transforming incoming articles into highly engaging posts.  \n\n# Task Specification  \nUsing the provided article, craft a LinkedIn post that is:  \n1. Written in a concise, engaging tone optimized for readability on mobile.  \n2. Tailored specifically to the target audience\u2019s interests, needs, and professional goals.  \n3. Plain text only, with frequent line breaks for clarity.  \n4. Incorporates 1-2 emojis to enhance personality and appeal.  \n5. Provides actionable value and includes a clear call to action.  \n6. Contains 3-5 relevant hashtags.  \n7. Outputs only the post text\u2014nothing else.  \n\n# Specifics and Context  \nThe post should succinctly capture the core message of the article while resonating with the audience\u2019s values. It must sound human and conversational, staying under 3,000 characters.  \n\n# Examples  \n## Example 1  \n**Input:** Article about productivity tips for managers.  \n**Output:**  \n\ud83d\udd25 Time to Supercharge Your Productivity!  \n\nManagers, are your days packed with back-to-back meetings and endless to-do lists? Here\u2019s the secret to working smarter, not harder: [insight summary].  \n\n\ud83d\udc49 Top tips to stay ahead:  \n1. Prioritize tasks using the Eisenhower Matrix.  \n2. Block time on your calendar for deep focus.  \n3. Delegate effectively to your team.  \n\nWhat strategies help you lead and manage your time effectively? Share your thoughts below!  \n\n#Leadership #TimeManagement #Productivity  \n\n# Reminders  \n- Ensure the content aligns with the target audience's interests and challenges.  \n- Always include 1-2 emojis and a call to action.  \n- Use plain text and only output the post content.  \n"
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "d03bd29e-82b2-4a74-9f79-2d4e80d2f65a",
      "name": "generate image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        -112
      ],
      "parameters": {
        "url": "https://black-forest-labs-flux-2-klein-9b.hf.space/gradio_api/call/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"data\": [\n    \"{{ $json.output }}\",\n    [],\n    \"Distilled (4 steps)\",\n    0,\n    true,\n    1024,\n    1024,\n    4,\n    1,\n    false\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.3
    },
    {
      "id": "84cec2c7-1a13-451a-ab2a-a89c716b0354",
      "name": "get image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1232,
        -112
      ],
      "parameters": {
        "url": "=https://black-forest-labs-flux-2-klein-9b.hf.space/gradio_api/call/generate/{{ $json.event_id }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "7131a0cc-09e2-4ee5-9f28-cbe9a1ee1166",
      "name": "image URL",
      "type": "n8n-nodes-base.set",
      "position": [
        1424,
        -112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ba2a4f75-12c4-4bff-8375-47345d97d5be",
              "name": "data",
              "type": "array",
              "value": "={{ $json.data.slice(22) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a72408da-db22-4cb2-90d0-b6b9a62eab39",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 176,
        "height": 224,
        "content": "## AI model"
      },
      "typeVersion": 1
    },
    {
      "id": "e3e10b91-aa4a-4f98-9a3d-966e805856ba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        -400
      ],
      "parameters": {
        "width": 736,
        "height": 1072,
        "content": "## AI LinkedIn Post Generator: From Topic to Image & Text\n\nTransform your content queue into a high-engagement LinkedIn presence with zero manual effort. The **AI LinkedIn Post Generator** workflow automates every step of the content creation process. It pulls a topic from your backlog, conducts real-time web research for the latest trends and statistics, drafts a professional post, and even generates a custom AI image to accompany it.\n\nBy combining **Gemini 2.5 Flash**, **Olostep**, and **Hugging Face** image models, this workflow ensures your social media activity remains consistent, relevant, and visually striking.\n\n---\n\n### Who\u2019s it for?\n*   **Solopreneurs & Creators:** Maintain a high-quality LinkedIn presence while focusing on your core business.\n*   **Content Marketers:** Quickly generate drafts and visuals for a volume-heavy social media strategy.\n*   **Personal Brands:** Stay relevant by automatically incorporating real-time news and statistics into your posts.\n*   **Social Media Agencies:** Scale client content production by automating the research and drafting phases.\n\n### How it works / What it does\n1.  **Trigger:** Manual execution or scheduled trigger kicks off the process.\n2.  **Topic Retrieval:** Fetches the next topic marked as \"To-Do\" from a **Google Sheet**.\n3.  **Web Research:** **Olostep** scans the web for key insights, recent trends, and supporting statistics related to the topic.\n4.  **Parallel Generation:**\n    *   **Post Writer:** Gemini drafts an engaging, mobile-optimized LinkedIn post with emojis, hashtags, and a clear Call to Action (CTA).\n    *   **Image Prompt Generator:** A second AI agent crafts a detailed visual prompt based on the research findings.\n5.  **Visual Creation:** The workflow calls a **Hugging Face** model (FLUX) to generate a unique image for the post.\n6.  **Finalization:** The post text and image URL are saved back to the **Google Sheet**, the status is updated to \"Done,\" and you receive a **Gmail** notification that your content is ready.\n\n### How to set up\n1.  **Credentials:** Add your API keys for **Google Gemini (PaLM)**, **Olostep**, **Hugging Face**, **Google Sheets**, and **Gmail**.\n2.  **Google Sheet Setup:** Create a sheet with columns for `topic`, `status`, `post`, and `image`. Populate the `topic` column and set the initial `status` to \"To-Do\".\n3.  **Notification:** Update the **Gmail** node with your email address to receive completion alerts.\n\n### Requirements\n*   **Google Gemini API:** For research synthesis and professional copywriting.\n*   **Olostep API:** To gather real-time data and \"current\" context.\n*   **Hugging Face API:** (Or any preferred image model API) for visual generation.\n*   **Google Workspace (OAuth2):** For sheet management and email alerts.\n\n### How to customize the workflow\n*   **Visual Style:** Modify the \"Image Prompt Generator\" system message to enforce a specific brand aesthetic (e.g., \"minimalist 3D,\" \"professional photography,\" or \"flat illustration\").\n*   **Post Tone:** Adjust the \"Post Writer\" agent to match your specific voice, whether it's \"brutally honest,\" \"playful,\" or \"academic.\"\n*   **Multi-Post Generation:** Update the logic to process multiple \"To-Do\" rows in a single run for weekly content batching."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "093470f7-a6e2-4adf-b61b-2f92823ab5dc",
  "connections": {
    "get image": {
      "main": [
        [
          {
            "node": "image URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get topic": {
      "main": [
        [
          {
            "node": "Create answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "image URL": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Writer": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create answer": {
      "main": [
        [
          {
            "node": "Post Writer",
            "type": "main",
            "index": 0
          },
          {
            "node": "Image Prompt Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "generate image": {
      "main": [
        [
          {
            "node": "get image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt Generator": {
      "main": [
        [
          {
            "node": "generate image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Post Writer",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Image Prompt Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "get topic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}