AutomationFlowsAI & RAG › Generate AI LinkedIn Posts with Google Gemini

Generate AI LinkedIn Posts with Google Gemini

Original n8n title: Generate Ai-powered Linkedin Posts with Google Gemini and Gen-imager

ByEvoort Solutions @evoortsolutions on n8n.io

This workflow automatically generates LinkedIn posts based on a user-submitted topic, including both content creation and image generation, then publishes the post to LinkedIn. Ideal for marketers, content creators, or businesses looking to streamline their social media…

Event trigger★★★★☆ complexityAI-powered16 nodesForm TriggerAgentGoogle Gemini ChatHTTP RequestLinkedIn
AI & RAG Trigger: Event Nodes: 16 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Agent → Form Trigger 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
{
  "id": "vqN5q4DY1j8QQdck",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered LinkedIn Post Automation",
  "tags": [
    {
      "id": "TZGpFRr1DpwFbL3j",
      "name": "LinkedIn",
      "createdAt": "2025-05-29T11:14:22.147Z",
      "updatedAt": "2025-05-29T11:14:22.147Z"
    },
    {
      "id": "QXtLNWbsCSABOTNm",
      "name": "Digital Marketing",
      "createdAt": "2025-05-29T11:14:57.099Z",
      "updatedAt": "2025-05-29T11:14:57.099Z"
    }
  ],
  "nodes": [
    {
      "id": "ab4282b8-43e9-466a-9986-70e5e449eb5e",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "LinkedIn Post Generator ",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Topic",
              "placeholder": "Enter prompt here....",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e593eb90-b859-499b-8b18-3f8fbe8017da",
      "name": "Mapper",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "694a158d-53fd-425c-9a42-be4288c17ac9",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.Topic }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c48b5989-66ed-4fe2-96a2-6b540ac87d54",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        500,
        0
      ],
      "parameters": {
        "options": {
          "systemMessage": "=I need help creating a professional LinkedIn post for the topic: \"{{ $json.chatInput }}\". The output should include:\n\n1. **LinkedIn Post Content**:\n   - Write an engaging and informative LinkedIn post on the topic \" {{ $json.chatInput }}\".\n   - Start with an attention-grabbing hook that entices readers to read further.\n   - Provide valuable insights or actionable tips related to the topic.\n   - The tone should be professional, clear, and concise, using language that's easy to understand.\n   - End with a call to action (CTA) encouraging the audience to engage, reflect, or share their thoughts.\n   - Include relevant hashtags to increase engagement and visibility on LinkedIn. Make sure these hashtags are specific to the topic and aligned with trending keywords for LinkedIn posts.\n\n2. Image Generation Prompt:\n\nVisual Aesthetic:\nThe image should align with LinkedIn's professional and corporate atmosphere. Make sure it conveys sophistication, modernity, and relevance to the topic. Avoid overly busy designs.\n\nColor Palette:\nStick to corporate tones such as blues, whites, and grays to maintain a professional and clean look. Consider using gradients for depth or subtle contrasts to highlight key elements.\n\nImagery:\n\nFocus on visualizing the topic of the post. For AI in Business, this could involve:\n\nA futuristic office or workspace setting, highlighting cutting-edge technologies.\n\nIcons or symbols that represent data analysis, AI, or automation.\n\nVisuals of humans interacting with AI systems (e.g., robots working alongside humans or using AI tools).\n\nAbstract representations of neural networks or digital data flows.\n\nNo Text Overlay:\n\nDo not include any text in the image, ensuring it remains clean and focuses solely on the visuals.\n\nText overlays or titles are not necessary in this case to keep the professional look intact.\n\nStyle and Tone:\n\nThe design should be minimalist, modern, and sleek. Use a balanced layout with a focus on professional imagery that resonates with business-minded audiences.\n\nAvoid overly complex or distracting backgrounds\u2014keep it clean and visually appealing.\n\nFont Style (if applicable):\n\nIf any text were used in future visuals or branding (though none should appear in this image), use clean, modern fonts like Helvetica, Arial, or Roboto\u2014sans-serif fonts that are readable and professional.\n\nimage prompt can be like this short and simple\nA modern co-working space where AI assistants and human employees brainstorm around a digital whiteboard. The scene shows innovation and teamwork, with a multicultural group, smart gadgets, and subtle futuristic elements. Warm natural lighting and a balanced, professional layout ideal for a LinkedIn audience.\n the JSON output would look like this:\n{\n  \"post_content\": {\n    \"text\": \"The Future of AI in Business: How It is Transforming Industries \ud83d\ude80\\n\\nAI in Business is no longer just a buzzword; it's revolutionizing the way businesses operate today. From improving efficiency to driving innovation, AI is an essential tool for modern companies.\\n\\nHere are some key insights on how AI in Business is shaping the future of industries:\\n1. Enhanced Data Analytics: AI helps businesses make data-driven decisions with greater accuracy.\\n2. Automation of Tasks: AI is automating repetitive tasks, improving operational efficiency.\\n3. Personalized Experiences: AI is enabling personalized customer experiences in real-time.\\n\\nIs your business ready to embrace AI in Business? Let's discuss how it can help drive growth and innovation.\\n\\n#AIinBusiness #Innovation #FutureOfWork #BusinessGrowth #TechnologyTrends #DigitalTransformation\"\n  },\n  \"image_prompt\": {\n    \"description\": \"Create an image for a LinkedIn post on the topic of AI in Business. The image should:\\n- Feature modern, sleek visuals that align with the corporate tone of LinkedIn.\\n- Visualize AI in Business through elements like a futuristic office, AI-powered systems, or human-robot collaboration.\\n- Use a professional color palette like blues, whites, and grays.\\n- The optional text overlay (if relevant) could be something like 'The Future of AI in Business' or 'Driving Innovation with AI'.\\n- The design should use clean, modern fonts that are easily readable and match the professional style of LinkedIn posts.\"\n  }\n}\n"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e56b669f-caa5-435d-be77-8abf8d79d4fc",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        460,
        240
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9af3d1f9-3085-4479-83eb-eab69050b65f",
      "name": "Decoder",
      "type": "n8n-nodes-base.code",
      "position": [
        1460,
        0
      ],
      "parameters": {
        "jsCode": "// Extract the data field (which is a string) and parse it into a JSON object\nconst dataString = $input.first().json.data;\n\n// Parse the data string into a valid JSON object\nconst dataObject = JSON.parse(dataString);\n\n// Now you can safely extract the base64 image data\nconst base64Image = dataObject.base64_img;\n\n// Decode the base64 string and create a buffer from it\nconst buffer = Buffer.from(base64Image, 'base64');\n\n// You can optionally store this buffer in a temporary file or return the buffer as-is\nreturn {\n  json: {\n    decoded_image_buffer: buffer.toString('base64'), // Returning as base64 for further processing\n    image_length: buffer.length, // Optional: To verify the size of the decoded image\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8ebd423c-16da-4a44-8c96-07683fe4659f",
      "name": "Normalizer",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        0
      ],
      "parameters": {
        "jsCode": "const input = $input.first().json.output\n\nconst cleanedInput = input.replace(/```json|```/g, '').trim();\n\n// Parse the cleaned JSON\nconst parsedOutput = JSON.parse(cleanedInput);\n\n// Extract the `post_content.text` and `image_prompt.description` details\nconst postContent = parsedOutput.post_content.text;\nconst imagePrompt = parsedOutput.image_prompt.description;\n\n// Prepare the final output in the desired JSON structure\nreturn {\n  post_content: postContent,\n  image_prompt: imagePrompt\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "bb7ac25e-e584-4737-9aa2-4f7e7ffb9971",
      "name": "Text to image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1180,
        0
      ],
      "parameters": {
        "url": "https://gen-imager.p.rapidapi.com/genimager/index.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "Prompt",
              "value": "={{ $json.image_prompt }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "gen-imager.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your gen-imager rapid api key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5feeaf28-1efd-4624-ba09-947133b247ec",
      "name": "LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1760,
        0
      ],
      "parameters": {
        "text": "={{ $('Normalizer').item.json.post_content }}",
        "additionalFields": {},
        "binaryPropertyName": "={{ $json.decoded_image_buffer }}",
        "shareMediaCategory": "IMAGE"
      },
      "typeVersion": 1
    },
    {
      "id": "a984e557-1239-4905-bca3-ed6040cef517",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -300
      ],
      "parameters": {
        "height": 700,
        "content": "> **AI-Powered LinkedIn Post Automation**  \n>  \n> This workflow automates the process of creating LinkedIn posts based on user-submitted topics. It generates both **content** and a **professional image** using AI, and automatically publishes the post to LinkedIn.\n>  \n> - **Trigger**: Activated when a user submits a form with a topic for a LinkedIn post.\n> - **AI Content Generation**: Uses Google Gemini to generate an engaging post and image prompt.\n> - **Image Creation**: The prompt is sent to **[gen-imager API](https://rapidapi.com/PrineshPatel/api/gen-imager)** for image generation.\n> - **Post Creation**: The generated text and image are posted directly to LinkedIn.\n>  \n> **Key Features**:  \n> 1. Automated post creation for LinkedIn.  \n> 2. Professional image generation with an AI-driven prompt.  \n> 3. Instant publishing to your LinkedIn feed.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a402ed2c-1970-4e4d-b78d-618d335d6034",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "**On Form Submission**  \n> Triggered when a user submits a topic through the form. This starts the workflow and captures the topic to generate a LinkedIn post.\n  "
      },
      "typeVersion": 1
    },
    {
      "id": "8a027b14-4b84-4efb-b3df-94c29f59ead2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "> **Mapper**  \n> Maps the user-submitted topic from the form and prepares it for the next step by assigning it to a variable (`chatInput`).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "dcb0b306-9b48-4db9-8bdf-8b39f163d102",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -160
      ],
      "parameters": {
        "width": 300,
        "height": 320,
        "content": "**AI Agent**  \n> Uses the **Google Gemini** model to generate professional content for the LinkedIn post, including text and an image prompt based on the given topic.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "edc1b46c-2ba7-4de9-bcfd-11bb3f750d17",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": " **Normalizer**  \n> Cleans and formats the AI-generated output into a readable structure for the next steps, extracting both the post text and image prompt.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "17a43c84-0dbf-4217-bb11-486a58d62c7a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "> **Text to Image**  \n> Sends the image prompt to the **[gen-imager API](https://rapidapi.com/PrineshPatel/api/gen-imager)** to generate a professional image for the LinkedIn post based on the given topic.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "8c1fa58f-c4c1-4751-8126-814ff0c9dfd1",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "**Decoder**  \n> Decodes the image from its base64 format into a usable binary buffer that can be uploaded to LinkedIn.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e1e20396-2fa5-4574-bab6-eb6dbad793fe",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "> **LinkedIn**  \n> Publishes the generated LinkedIn post, including the text and the newly created image, directly to the user's LinkedIn profile.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "398b0e27-ca1f-45e2-a18e-f86b387d8bb2",
  "connections": {
    "Mapper": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decoder": {
      "main": [
        [
          {
            "node": "LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Normalizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalizer": {
      "main": [
        [
          {
            "node": "Text to image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text to image": {
      "main": [
        [
          {
            "node": "Decoder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Mapper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

This workflow automatically generates LinkedIn posts based on a user-submitted topic, including both content creation and image generation, then publishes the post to LinkedIn. Ideal for marketers, content creators, or businesses looking to streamline their social media…

Source: https://n8n.io/workflows/5002/ — 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

How it works: This end-to-end workflow automates your personal or brand content strategy by: 🧠 Using Google Gemini or OpenAI to generate engaging LinkedIn/X content from a title or trending posts. 🗓️

Google Gemini Chat, Form Trigger, Agent +8
AI & RAG

How it Works

Memory Buffer Window, Agent, Output Parser Structured +9
AI & RAG

This automated workflow template transforms a single product image into a complete professional advertisement video with dynamic motion and custom soundtrack. Perfect for e-commerce businesses, market

HTTP Request, Output Parser Structured, Tool Think +4
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

This is an automated blog post generation system that: Researches topics using AI agents and web search tools Writes complete blog posts with proper SEO structure Generates custom images for each post

Output Parser Structured, Google Gemini Chat, HTTP Request Tool +11