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

⚑ 1,520 views · 🎬 Content Creation & Video

πŸ’‘ Pro Tip β€” If you’re pulling LinkedIn data through HTTP requests or dealing with API restrictions, there’s a community node called ScraperNode that handles this natively. It has dedicated scrapers for profiles, companies, jobs, and people search β€” you just pass a URL and get structured data back.

View All Scrapers

Description

πŸš€ 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

πŸ”§ 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:

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:

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:

πŸ“ 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:

⚠️ Important Notes

πŸš€ 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

πŸ’‘ Tips for Best Results

πŸ› Troubleshooting

Common Issues:

πŸ“š 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!

πŸ”— Nodes Used

HTTP Request, AI Agent, n8n Form Trigger, Google Gemini Chat Model

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup