Skip to main content

AI content creation and auto WordPress publishing with Pexels API image workflow

Workflow preview

Workflow preview
100%
AI content creation and auto WordPress publishing with Pexels API image workflow 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 content creation and WordPress publishing workflow Summary This workflow automates the entire process of blog content creation, from idea generation and article writing using Google Gemi...

Best for

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

Tools used

n8n-nodes-base.googlesheets, n8n-nodes-base.set, n8n-nodes-base.wordpress, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.formtrigger, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
AI content creation and auto WordPress publishing with Pexels API image workflow
Workflow name
AI content creation and auto WordPress publishing with Pexels API image workflow

AI powered content creation and WordPress publishing workflow

Summary

This workflow automates the entire process of blog content creation, from idea generation and article writing using Google Gemini, to sourcing images from Pexels and publishing directly to your WordPress site. It uses Google Sheets as a central hub for managing content ideas and tracking their status, all orchestrated through interactive n8n forms.

Key features

  • AI driven content: Leverages Google Gemini for generating:
    • Full blog articles based on prompts.
    • Relevant keywords for image searching.
    • New blog topic ideas.
  • Automated image sourcing: Searches Pexels for suitable images based on AI generated keywords and downloads them.
  • WordPress integration:
    • Creates new posts with AI generated title and content.
    • Uploads sourced images to the WordPress media library.
    • Sets the uploaded image as the featured image for the post.
  • Google Sheets management:
    • Fetches content ideas (prompts) marked as "not generated".
    • Updates the sheet after a post is generated with the post ID, title, and generation date.
    • Adds newly AI generated blog topic ideas to the sheet.
  • Interactive forms:
    • Main trigger form to choose between generating content or adding new ideas.
    • Forms to input topics for idea generation.
    • Confirmation forms at the end of processes.
  • Structured output parsing: Ensures AI responses for topic generation are correctly formatted as JSON.

How it works

The workflow is initiated via an n8n Form Trigger: Select Action, allowing the user to choose one of two main paths:

1. Generate content path: * Fetch idea: The Fetch unprocessed ideas (Google Sheets) node retrieves a row from your sheet where the "Generated" column is "no". * Set prompt: The Set prompt node prepares the topic from the sheet for the AI. * Generate article: The Generate article AI (Langchain Agent with Google Gemini) node takes the prompt and writes a full article. * Generate image keyword: The Generate image keyword AI (Langchain Agent with Google Gemini) node creates a concise search term based on the article topic. * Search image: The Search Pexels image (HTTP Request) node uses the generated keyword to find a relevant image via the Pexels API. * Create WordPress post: The Create WordPress post node publishes the AI generated article and initial image metadata to your WordPress site. * Download and upload image: The Download Pexels image (HTTP Request) node fetches the actual image file, and the Upload image (HTTP Request) node uploads it to your WordPress media library. * Set featured image: The Set featured image (HTTP Request) node links the uploaded image as the featured image for the newly created post. * Update sheet: The Update Google Sheet node marks the idea as "yes" in your Google Sheet and adds the WordPress post ID and title. * Confirmation: A Form: End post generation node displays a completion message.

2. Add ideas path: * Input topic: The Form: Enter topic for ideas node prompts the user to enter a general subject. * Generate topics: The Generate blog topics AI (Langchain Agent with Google Gemini and Structured Output Parser) node generates five SEO friendly blog topic ideas based on the user's input, formatted as JSON. * Process topics: The Split topics node separates the generated list of topics into individual items. * Add to sheet: For each topic, the Add ideas to sheet (Google Sheets) node appends it as a new row, marked with "Generated: no". * Loop or end: The Form: Add more topics? node asks the user if they want to generate more ideas or end the process. * If "NEXT", it loops back to the Form: Enter topic for ideas. * If "END", a Form: End idea generation node displays a completion message with the list of added topics.

Nodes used

  • Form Trigger
  • If
  • Google Sheets
  • Set
  • Langchain Agent (with Google Gemini Chat Model)
  • Structured Output Parser (Langchain)
  • HTTP Request (for Pexels API and WordPress Media/Post updates)
  • WordPress
  • Split Out
  • Form (for user interaction and completion messages)
  • Sticky Note (for instructions within the workflow)

Setup instructions

  1. Credentials:
    • Google Sheets: Configure your Google Sheets OAuth2 credentials in the Fetch unprocessed ideas, Update Google Sheet, and Add ideas to sheet nodes.
    • WordPress: Configure your WordPress API credentials in the Create WordPress post, Upload image, and Set featured image nodes.
    • Google Gemini: Configure your Google Gemini (PaLM) API key in the Gemini model for article, Gemini model for image keyword, and Gemini model for topics nodes.
  2. API keys and URLs:
    • Pexels: In the Search Pexels image node, replace <YOUR_PEXELS_API_KEY> in the Authorization header with your actual Pexels API key.
    • WordPress URL: In the Upload image and Set featured image nodes, replace <YOUR_WORDPRESS_URL> in the URL field with your WordPress site's domain (e.g., yourblog.com).
  3. Google Sheet configuration:
    • Ensure your Google Sheet (specified by Document ID in Google Sheets nodes) has a sheet named Sheet1 (or update the Sheet Name parameter).
    • The sheet should have at least the following columns: Prompt (for the blog idea/topic), Generated (to track status, e.g., "no" or "yes"), row_number (automatically populated by n8n when reading), Date, Title (for the final WordPress post title), Post ID.
  4. Activate the workflow. The Form Trigger: Select Action will provide a webhook URL to initiate the process.

Customization ideas

  • Modify the AI prompts in the Langchain Agent nodes for different tones, styles, or content structures.
  • Change the Google Gemini models used for different cost/performance balances.
  • Integrate other image sources instead of or in addition to Pexels.
  • Add steps for social media sharing after a post is published.
  • Extend the Google Sheet to track more metrics like word count or target keywords.
  • Implement more sophisticated error handling.

Use cases

  • Automating blog content generation for personal or company blogs.
  • Streamlining content marketing efforts.
  • Quickly populating new websites with initial content.
  • Assisting SEO agencies in creating draft content for clients.
  • Helping solo bloggers maintain a consistent publishing schedule.

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 - Fetch Unprocessed Ideas

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 2 - Set Prompt

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

Block 3 - Create WordPress Post

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

Block 4 - Upload Image

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

Block 5 - Set Featured Image

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

Block 6 - Update Google Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 7 - Generate Article AI

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

Block 8 - Generate Image Keyword AI

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

Block 9 - Gemini Model for Article

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

Block 10 - Gemini Model for Image Keyword

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

Block 11 - Search Pexels Image

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

Block 12 - Download Pexels Image

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

Block 13 - Form Trigger: Select Action

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

Block 14 - If Generate Content

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

Block 15 - Add Ideas to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 16 - Generate Blog Topics AI

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

Block 17 - Form: Enter Topic for Ideas

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

Block 18 - Form: Add More Topics?

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

Block 19 - If Add More Topics

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

Block 20 - Gemini Model for Topics

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

Block 21 - Parse AI Topic Output

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 22 - Split Topics

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

Block 23 - Form: End Idea Generation

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

Block 24 - Form: End Post Generation

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

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

3. Summary Table

Workflow AI content creation and auto WordPress publishing with Pexels API image workflow
Complexity advanced
Nodes 30
Categories Content Creation, Multimodal AI
Author Mateusz Kosiorek
Published 23 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5159/5159.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 AI content creation and auto WordPress publishing with Pexels API image workflow do?

AI powered content creation and WordPress publishing workflow Summary This workflow automates the entire process of blog content creation, from idea generation and article writing using Google Gemi...

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.