Skip to main content

Generate SEO blog drafts from Google Sheets to WordPress with OpenAI

Workflow preview

Workflow preview
100%
Generate SEO blog drafts from Google Sheets to WordPress with OpenAI preview
Open on n8n.io

1. Workflow Overview

Description Generate SEO friendly WordPress blog drafts from a Google Sheets queue using OpenAI . This workflow writes full HTML blog content , selects a relevant Pexels featured image with a secon...

Best for

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

Tools used

n8n-nodes-base.switch, n8n-nodes-base.httprequest, n8n-nodes-base.splitinbatches, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.googlesheets, n8n-nodes-base.set, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Tan Yit Shen.

Original n8n.io source

1.1 Workflow description

Title
Generate SEO blog drafts from Google Sheets to WordPress with OpenAI
Workflow name
Generate SEO blog drafts from Google Sheets to WordPress with OpenAI

Description

Generate SEO-friendly WordPress blog drafts from a Google Sheets queue using OpenAI. This workflow writes full HTML blog content, selects a relevant Pexels featured image with a second AI Agent, uploads the image to WordPress, creates the post as a draft, routes posts to the correct WordPress site, updates the sheet with the draft/post URL, logs failures, and sends a Gmail completion email.

What This Workflow Does

This workflow automates the blog draft creation process from Google Sheets to WordPress.

It can:

  • Read pending blog requests from Google Sheets
  • Process only rows where done is unchecked, empty, or set to false
  • Generate SEO-friendly blog drafts with OpenAI
  • Create a WordPress-ready HTML article with H2/H3 headings, paragraphs, lists, and internal links
  • Generate a blog title, SEO meta title, SEO meta description, URL slug, primary keyword, and image search query
  • Search Pexels for relevant landscape images
  • Use a second AI Agent to choose the most suitable featured image
  • Generate natural image alt text
  • Store selected image details back into Google Sheets
  • Upload the selected image to the WordPress media library
  • Create the WordPress post as a draft
  • Set the uploaded image as the featured image
  • Route posts to the correct WordPress site based on the website column
  • Update the sheet with the WordPress draft/post URL and mark the row as complete
  • Log failures, empty runs, and completion events with timestamps
  • Send a Gmail completion email after all rows are processed

Who Is This For?

This workflow is useful for:

  • SEO agencies producing blog drafts for multiple client websites
  • Content teams managing a publishing queue in Google Sheets
  • WordPress site managers who want to reduce manual content uploading
  • Freelancers who prepare draft posts for client review
  • Businesses that want AI-assisted content drafts without auto-publishing

How It Works

  1. A Schedule Trigger runs the workflow daily at 8am by default. You can also run it manually for testing.
  2. The workflow reads rows from the Google Sheets template.
  3. It filters for rows that are not completed yet.
  4. For each pending row, the SEO Blog AI Agent generates a structured blog draft based on the website, language, word count, keyword, meta fields, and target URL.
  5. The workflow searches Pexels using the AI-generated image search query.
  6. The Image AI Agent reviews the Pexels results and selects the best featured image for the article.
  7. Image URL, alt text, photographer name, and Pexels URL are written back into Google Sheets.
  8. The image is downloaded and uploaded to the correct WordPress site.
  9. The workflow creates the WordPress blog post as a draft.
  10. The uploaded image is set as the featured image.
  11. The workflow updates the row with the WordPress draft/post URL and marks it as done.
  12. Errors are logged to the Logs sheet, and the workflow continues with the next row where possible.
  13. After all rows are processed, Gmail sends a completion email.

Setup Guide

  1. Copy the Google Sheets template: Click Here
  2. Connect your Google Sheets credential in all Google Sheets nodes.
  3. For Google Sheets nodes starting with Log, select the Logs sheet.
  4. For the other Google Sheets nodes, select the Automation sheet.
  5. Connect your OpenAI credential in the Blog Article Model and Image Model nodes.
  6. Add your Pexels API key to the Pexels HTTP Request node using Header Auth.
  7. Connect your Gmail account and set the email recipient in the Gmail node.
  8. Create a WordPress Application Password for each WordPress site.
  9. Configure the WordPress and HTTP Request credentials for each site.
  10. Update the Map to WordPress Site Switch node so each domain routes to the correct WordPress node group.
  11. Add one test row in Google Sheets.
  12. Run the workflow manually and confirm that the post appears as a draft in WordPress.
  13. Activate the workflow when testing is complete.

Multi-Site WordPress Setup

The workflow supports multiple WordPress sites by routing each row based on the website column.

The template includes sample routing for two websites. To add another WordPress site:

  1. Duplicate the WordPress node group.
  2. Add the new WordPress credentials.
  3. Add a new routing rule in the Map to WordPress Site node.
  4. Match the new rule to the domain used in the Google Sheet.
  5. Connect the new Switch output to the duplicated WordPress node group.
  6. Connect the error outputs to the existing error logging path.

Customization Ideas

You can customize this workflow to:

  • Change the default schedule
  • Adjust the OpenAI model
  • Modify the blog writing prompt
  • Change the article structure or tone
  • Add more internal links
  • Add category or tag assignment in WordPress
  • Connect Yoast, Rank Math, or custom fields for SEO metadata
  • Add Slack, Discord, or email error alerts
  • Publish automatically after approval
  • Add a human approval step before WordPress draft creation

Important Notes

  • This workflow creates WordPress posts as drafts. It does not publish posts automatically.
  • The generated content should be reviewed before publishing.
  • SEO meta title and meta description are generated in the AI output, but you may need to add extra nodes if you want to write them into a specific WordPress SEO plugin.
  • Each WordPress site needs its own credentials and routing rule.
  • Make sure your Pexels usage follows Pexels terms and your own content policy.
  • Do not hardcode API keys, passwords, or tokens inside HTTP request URLs or request bodies. Use n8n credentials instead.

Integrations

Google Sheets · OpenAI (ChatGPT) · Pexels API · WordPress REST API · Gmail

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 - Map to WordPress Site

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

Block 2 - Fetch Images from Pexels

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

Block 3 - Loop for Each Row

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 4 - Sticky Note

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

Block 5 - Image AI Agent

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

Block 6 - SEO Blog AI Agent

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

Block 7 - Download Image

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

Block 8 - Update wp_url and status

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

Block 9 - Pack Image Data

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

Block 10 - Gather All Data for Update

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

Block 11 - Sticky Note1

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

Block 12 - Sticky Note2

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

Block 13 - Sticky Note3

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

Block 14 - Send Completion Email

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

Block 15 - Sticky Note4

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

Block 16 - Sticky Note5

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

Block 17 - Sticky Note6

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

Block 18 - Sticky Note7

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

Block 19 - Sticky Note8

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

Block 20 - Get All Info Required from Sheets

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

Block 21 - Sticky Note9

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

Block 22 - Log Error

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

Block 23 - Set Error

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

Block 24 - Set Complete

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

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

3. Summary Table

Workflow Generate SEO blog drafts from Google Sheets to WordPress with OpenAI
Complexity advanced
Nodes 58
Categories Content Creation, Multimodal AI
Author Tan Yit Shen
Published 19 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15814/15814.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 SEO blog drafts from Google Sheets to WordPress with OpenAI do?

Description Generate SEO friendly WordPress blog drafts from a Google Sheets queue using OpenAI . This workflow writes full HTML blog content , selects a relevant Pexels featured image with a secon...

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.