Skip to main content

Generate LinkedIn posts with Gemini content & Imagen images for instant publishing

Workflow preview

Workflow preview
100%
Generate LinkedIn posts with Gemini content & Imagen images for instant publishing preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

AI Powered LinkedIn Post Generator with Automated Image Creation Overview Transform any topic into professional LinkedIn posts with AI generated content and custom images! This workflow autom...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.httprequest, n8n-nodes-base.wait

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Naitik Joshi.

Original n8n.io source

1.1 Workflow description

Title
Generate LinkedIn posts with Gemini content & Imagen images for instant publishing
Workflow name
Generate LinkedIn posts with Gemini content & Imagen images for instant publishing

πŸš€ AI-Powered LinkedIn Post Generator with Automated Image Creation

πŸ“‹ Overview

Transform any topic into professional LinkedIn posts with AI-generated content and custom images! This workflow automates the entire process from topic input to published LinkedIn post, including professional image generation using Google's Imagen 4 API.

✨ Key Features

  • πŸ€– AI Content Generation: Uses Google Gemini to create engaging LinkedIn posts
  • 🎨 Professional Image Creation: Automatically generates images using Google Imagen 4
  • πŸ“± Direct LinkedIn Publishing: Posts content and images directly to your LinkedIn feed
  • πŸ”„ Form-Based Input: Simple web form to submit topics
  • πŸ“ Content Formatting: Converts markdown to LinkedIn-friendly format

πŸ”§ What This Workflow Does

  1. πŸ“ Form Submission: User submits a topic through a web form
  2. πŸ—ΊοΈ Data Mapping: Maps the topic for AI processing
  3. 🧠 AI Content Generation: Google Gemini creates post content and image prompt
  4. 🎯 Content Normalization: Cleans and formats the AI output
  5. πŸ–ΌοΈ Image Generation: Creates professional images using Google Imagen 4
  6. πŸ“€ LinkedIn Registration: Registers image upload with LinkedIn API
  7. πŸ”„ Binary Conversion: Converts base64 image to binary buffer
  8. ⬆️ Image Upload: Uploads image to LinkedIn
  9. πŸ“‹ Content Curation: Converts markdown to LinkedIn format
  10. ⏳ Processing Wait: Ensures image is fully processed
  11. πŸš€ Post Publishing: Publishes the complete post to LinkedIn

πŸ› οΈ Prerequisites & Setup

πŸ”‘ Required Credentials

1. LinkedIn OAuth 2.0 Setup πŸ”—

You'll need to create a LinkedIn app with the following OAuth 2.0 scopes:

  • βœ… openid - Use your name and photo
  • βœ… profile - Use your name and photo
  • βœ… w_member_social - Create, modify, and delete posts, comments, and reactions on your behalf
  • βœ… email - Use the primary email address associated with your LinkedIn account

Steps to get LinkedIn credentials:

  1. Go to LinkedIn Developer Portal
  2. Create a new app or use existing one
  3. Configure OAuth 2.0 settings with the scopes above
  4. Get your access token from the authentication flow
2. Google Cloud Platform Setup ☁️

Required GCP Services to Enable:

  • 🎯 Vertex AI API - For Imagen 4 image generation
  • πŸ” Cloud Resource Manager API - For project management
  • πŸ›‘οΈ IAM Service Account Credentials API - For authentication

Steps to get GCP token:

  1. Install Google Cloud SDK
  2. Authenticate: gcloud auth login
  3. Set project: gcloud config set project YOUR_PROJECT_ID
  4. Get access token: gcloud auth print-access-token

> πŸ’‘ Note: The access token expires after 1 hour. For production use, consider using service account credentials.

πŸ”§ n8n Node Credentials Setup

  1. LinkedIn OAuth2 API: Configure with your LinkedIn app credentials
  2. HTTP Bearer Auth (LinkedIn): Use your LinkedIn access token
  3. HTTP Bearer Auth (Google Cloud): Use your GCP access token
  4. Google Gemini API: Configure with your Google AI API key

πŸ“Š Workflow Structure

graph LR
    A[πŸ“ Form Trigger] --> B[πŸ—ΊοΈ Mapper]
    B --> C[πŸ€– AI Agent]
    C --> D[🎯 Normalizer]
    D --> E[πŸ–ΌοΈ Text to Image]
    E --> F[πŸ“€ Register Upload]
    F --> G[πŸ”„ Binary Converter]
    G --> H[⬆️ Upload Image]
    H --> I[πŸ“‹ Content Curator]
    I --> J[⏳ Wait]
    J --> K[πŸš€ Publish to LinkedIn]

🎨 Image Generation Details

The workflow uses Google Imagen 4 with these parameters:

  • πŸ“ Aspect Ratio: 1:1 (perfect for LinkedIn)
  • 🎯 Sample Count: 1 options generated
  • πŸ›‘οΈ Safety Setting: Block few (content filtering)
  • πŸ’§ Watermark: Enabled
  • 🌍 Language: Auto-detect

πŸ“ Content Processing

The AI generates content in this JSON structure:

{
  "post_content": {
    "text": "Your engaging LinkedIn post content with hashtags"
  },
  "image_prompt": {
    "description": "Professional image generation prompt"
  }
}

πŸ”„ LinkedIn API Integration

Image Upload Process:

  1. Register Upload: Creates upload session with LinkedIn
  2. Binary Upload: Uploads image as binary data
  3. Post Creation: Creates post with text and image reference

API Endpoints Used:

  • πŸ“€ POST /v2/assets?action=registerUpload - Register image upload
  • πŸ“ POST /v2/ugcPosts - Create LinkedIn post

⚠️ Important Notes

  • πŸ• Rate Limits: LinkedIn has API rate limits - monitor your usage
  • ⏱️ Processing Time: Image generation can take 10-30 seconds
  • πŸ”„ Token Refresh: GCP tokens expire hourly in development
  • πŸ“ Content Length: LinkedIn posts have character limits
  • πŸ–ΌοΈ Image Size: Generated images are optimized for LinkedIn

πŸš€ Getting Started

  1. Import the workflow into your n8n instance
  2. Configure all credentials as described above
  3. Enable required GCP services in your project
  4. Test the form trigger with a sample topic
  5. Monitor the execution for any errors
  6. Adjust the AI prompt if needed for your content style

πŸ› οΈ Customization Options

  • 🎨 Modify image style in the system prompt
  • πŸ“ Adjust content tone in the AI agent configuration
  • πŸ”„ Change wait time between upload and publish
  • 🎯 Add content filters for brand compliance
  • πŸ“Š Include analytics tracking for post performance

πŸ’‘ Tips for Best Results

  • 🎯 Be specific with your topic inputs
  • 🏒 Use professional language for business content
  • πŸ” Review generated content before publishing
  • πŸ“ˆ Monitor engagement to refine your prompts
  • πŸ”„ Test thoroughly before production use

πŸ› Troubleshooting

Common Issues:

  • ❌ "Invalid credentials": Check token expiration
  • ❌ "Image upload failed": Verify LinkedIn API permissions
  • ❌ "Content generation error": Check Gemini API quota
  • ❌ "Post creation failed": Ensure proper wait time after image upload

πŸ“š Additional Resources


πŸ’¬ Need Help? Join the n8n community forum or check the troubleshooting section above!

🌟 Found this useful? Give it a star and share your improvements with the community!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 2 - Mapper

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 4 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 5 - Normalizer

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Register Image Upload

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 16 - Text to image1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Upload Image to LinkedIn1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 18 - Convert to binary buffer

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 20 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note11

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate LinkedIn posts with Gemini content & Imagen images for instant publishing
Complexity advanced
Nodes 25
Categories Content Creation, Multimodal AI
Author Naitik Joshi
Published 01 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6772/6772.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate LinkedIn posts with Gemini content & Imagen images for instant publishing do?

AI Powered LinkedIn Post Generator with Automated Image Creation Overview Transform any topic into professional LinkedIn posts with AI generated content and custom images! This workflow autom...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.