Gemini + LinkedIn: polished posts published for you
Writing a LinkedIn post is rarely “just writing a post”. It’s coming up with an angle, drafting, rewriting, finding (or making) an image, formatting, then finally posting. And somehow it still feels rushed.
This Gemini LinkedIn automation hits marketers first, but founders and agency operators feel it too. You want consistent posting without burning an hour a day on blank-page anxiety and last-minute image hunting.
This workflow turns a single topic submission into a polished LinkedIn post with a matching image, then publishes it for you. You’ll see how the automation works, what you need, and where teams usually tweak it to match their voice.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Gemini + LinkedIn: polished posts published for you
flowchart LR
subgraph sg0["On form submission Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>On form submission"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Mapper", pos: "b", h: 48 }
n2@{ icon: "mdi:robot", form: "rounded", label: "AI Agent", pos: "b", h: 48 }
n3@{ icon: "mdi:brain", form: "rounded", label: "Google Gemini Chat Model", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Decoder"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Normalizer"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Text to image"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/linkedin.svg' width='40' height='40' /></div><br/>LinkedIn"]
n1 --> n2
n4 --> n7
n2 --> n5
n5 --> n6
n6 --> n4
n0 --> n1
n3 -.-> n2
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n2 ai
class n3 aiModel
class n6 api
class n4,n5 code
classDef customIcon fill:none,stroke:none
class n0,n4,n5,n6,n7 customIcon
The Problem: LinkedIn Consistency Dies in Drafts
You tell yourself you’ll post three times a week. Then client work, meetings, and actual business priorities show up. When you finally carve out time, you’re stuck rewriting the opening hook, trimming paragraphs, and second-guessing tone. The image is its own mini project, so you skip it or grab something generic. Worst part: after all that effort, you still delay hitting “Post” because you’re not fully confident it’s good enough.
It adds up fast. Here’s where it breaks down in real life.
- Each post becomes a multi-step production task, so you keep pushing it to “tomorrow”.
- When the copy and image aren’t aligned, the post looks slapped together even if the idea is solid.
- Batching sounds smart, but it usually turns into a half-day writing session that you dread.
- Manual posting means inconsistency, and inconsistency makes LinkedIn growth painfully slow.
The Solution: One Topic In, A Published Post Out
This workflow starts with a simple form submission: you enter a topic and send it. n8n takes that topic, maps it into the right fields, then asks Google Gemini to draft a LinkedIn-ready post and generate a matching image prompt. Next, it sends that image prompt to an external image service (gen-imager) to create a professional visual that fits the post. The returned image comes back encoded, so the workflow decodes it into a file LinkedIn can accept. Finally, the workflow publishes the post text plus the generated image straight to your LinkedIn feed.
The flow begins with your topic form. Gemini handles the writing and the creative direction for the image, and gen-imager produces the visual. LinkedIn is the final stop, so the finished post goes live without you copying, pasting, downloading, or uploading anything.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you publish 4 times a week. Manually, a typical “polished” post takes about 30 minutes to write and another 20 minutes to find or create a decent image, then a few more minutes to format and upload, so you’re spending roughly 4 hours a week. With this workflow, you submit a topic in about 1 minute, then wait around 40 seconds for Gemini and the image API to do their thing. You get those hours back without lowering your standards.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Gemini API for writing the post and image prompt
- gen-imager API to generate the post image
- LinkedIn account access (OAuth) to publish posts
Skill level: Beginner. You’ll connect accounts, paste API keys, and adjust a few text prompts.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A topic submission triggers the workflow. Someone fills out your form (it can be internal for your team or just you), and n8n instantly captures the topic as the input.
The topic gets mapped into clean fields. n8n standardizes the input so Gemini receives a predictable structure, which helps keep outputs consistent.
Gemini drafts the post and the image direction. The workflow uses the Gemini chat model through an AI agent, then a cleanup step formats the response so you get usable post text plus a clear image prompt.
An image is generated, decoded, and posted to LinkedIn. n8n sends the image prompt to gen-imager via HTTP Request, decodes the returned base64 image buffer, and publishes everything in one LinkedIn post.
You can easily modify the tone and formatting to match your brand voice based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
Set up the form that initiates the workflow and captures the post topic.
- Add and open Form Entry Trigger.
- Set Form Title to
LinkedIn Post Generator. - Add a field with Field Label
Topic, PlaceholderEnter prompt here...., and mark it as Required. - Connect Form Entry Trigger to Map Input Fields.
Step 2: Connect Google Gemini
Configure the Gemini language model used by the AI agent to draft the post and image prompt.
- Open Gemini Chat Engine and set Model Name to
models/gemini-2.0-flash. - Credential Required: Connect your googlePalmApi credentials.
- Confirm Gemini Chat Engine is connected as the language model for Content Draft Agent (credentials should be added on Gemini Chat Engine, not the agent).
Step 3: Set Up Input Mapping and AI Drafting
Map form data into a single prompt and use the AI agent to generate the LinkedIn post and image prompt JSON.
- Open Map Input Fields and add an assignment: Name
chatInput, Typestring, Value{{ $json.Topic }}. - Open Content Draft Agent and set System Message to
=I need help creating a professional LinkedIn post for the topic: "{{ $json.chatInput }}". The output should include: 1. **LinkedIn Post Content**: - Write an engaging and informative LinkedIn post on the topic " {{ $json.chatInput }}". - Start with an attention-grabbing hook that entices readers to read further. - Provide valuable insights or actionable tips related to the topic. - The tone should be professional, clear, and concise, using language that's easy to understand. - End with a call to action (CTA) encouraging the audience to engage, reflect, or share their thoughts. - 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. 2. Image Generation Prompt: Visual Aesthetic: The 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. Color Palette: Stick 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. Imagery: Focus on visualizing the topic of the post. For AI in Business, this could involve: A futuristic office or workspace setting, highlighting cutting-edge technologies. Icons or symbols that represent data analysis, AI, or automation. Visuals of humans interacting with AI systems (e.g., robots working alongside humans or using AI tools). Abstract representations of neural networks or digital data flows. No Text Overlay: Do not include any text in the image, ensuring it remains clean and focuses solely on the visuals. Text overlays or titles are not necessary in this case to keep the professional look intact. Style and Tone: The design should be minimalist, modern, and sleek. Use a balanced layout with a focus on professional imagery that resonates with business-minded audiences. Avoid overly complex or distracting backgrounds—keep it clean and visually appealing. Font Style (if applicable): If 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—sans-serif fonts that are readable and professional. image prompt can be like this short and simple A 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. the JSON output would look like this: { "post_content": { "text": "The Future of AI in Business: How It is Transforming Industries 🚀\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" }, "image_prompt": { "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." } }. - Ensure the flow is Map Input Fields → Content Draft Agent → Clean Output Data.
Step 4: Configure Image Generation and Data Cleanup
Convert the AI output into structured fields, generate an image, and decode the resulting image data.
- Open Clean Output Data and keep the Code as provided to parse
$input.first().json.outputand returnpost_contentandimage_prompt. - Open Generate Image Request and set URL to
https://gen-imager.p.rapidapi.com/genimager/index.php. - Set Method to
POST, Send Body totrue, and Content Type tomultipart-form-data. - Add a body parameter Prompt with value
{{ $json.image_prompt }}. - Enable Send Headers and add header parameters:
x-rapidapi-host=gen-imager.p.rapidapi.comandx-rapidapi-key=[CONFIGURE_YOUR_API_KEY]. - Open Decode Image Buffer and keep the Code as provided to parse the response and return
decoded_image_buffer. - Confirm the flow Clean Output Data → Generate Image Request → Decode Image Buffer.
[CONFIGURE_YOUR_API_KEY] with your actual RapidAPI key or image generation requests will fail.Step 5: Configure the LinkedIn Posting Action
Publish the drafted post and generated image to LinkedIn.
- Open Post to LinkedIn Feed and set Text to
{{ $('Clean Output Data').item.json.post_content }}. - Set Binary Property Name to
{{ $json.decoded_image_buffer }}. - Set Share Media Category to
IMAGE. - Ensure the connection is Decode Image Buffer → Post to LinkedIn Feed.
Step 6: Test and Activate Your Workflow
Run a full test to verify the AI draft, image generation, and LinkedIn posting steps.
- Click Execute Workflow and submit the Form Entry Trigger with a sample
Topic. - Verify Content Draft Agent returns valid JSON, Clean Output Data extracts
post_contentandimage_prompt, and Generate Image Request responds with image data. - Confirm Post to LinkedIn Feed publishes a post with the generated image and drafted text.
- Once successful, toggle the workflow to Active to use it in production.
Common Gotchas
- LinkedIn credentials can expire or require extra permissions. If things break, check your n8n LinkedIn credential status and the LinkedIn app scopes first.
- The gen-imager API can be slow on busy days, so processing times vary. If your LinkedIn node fails because the image isn’t ready, increase the wait or add a simple retry before posting.
- Gemini prompts that are too generic will sound like everyone else. Add your brand POV (examples, audience, “things we never say”) early, honestly, or you’ll be editing every single draft.
Frequently Asked Questions
About 20 minutes if your accounts and API keys are ready.
No. You’ll mostly connect accounts and paste credentials into n8n.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini API usage and your image API costs from gen-imager.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll want to swap the final “Post to LinkedIn Feed” step for an approval checkpoint. A common approach is to add an If node that routes drafts to Google Sheets or email, then only publishes after you mark “Approved”. You can also adjust the Gemini system message inside the content generation step to lock in your tone, formatting, and banned phrases.
Usually it’s expired OAuth access or missing permissions on the LinkedIn app connection. Reconnect the LinkedIn credential in n8n, then confirm your LinkedIn app is allowed to publish on your behalf. If failures happen only sometimes, it can also be the image step returning an empty or invalid file, which then causes LinkedIn to reject the upload.
On a typical n8n Cloud plan, it can handle lots of daily posts, but your practical limit is more about monthly executions and your API budgets than the workflow itself. Each topic submission is one run, and each run usually finishes in under a minute. If you self-host, you’re mainly constrained by your server resources and rate limits from Gemini, gen-imager, and LinkedIn.
Often, yes, especially when you want AI steps, formatting cleanup, and file handling in one flow. n8n makes it easier to add branching logic (like “approve vs. auto-post”), and self-hosting can keep costs predictable if you run a lot of content. Zapier and Make can be quicker for very simple automations, but they tend to get awkward once you add image generation and multi-step transformations. Frankly, the “AI + image + publish” combo is where people start fighting their tools. Talk to an automation expert if you want help choosing.
Set this up once, then let the workflow do the repetitive parts every time you have an idea. You’ll post more consistently without turning LinkedIn into a daily writing assignment.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.