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
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
Setup instructions
Fetch unprocessed ideas
, Update Google Sheet
, and Add ideas to sheet
nodes.Create WordPress post
, Upload image
, and Set featured image
nodes.Gemini model for article
, Gemini model for image keyword
, and Gemini model for topics
nodes.Search Pexels image
node, replace <YOUR_PEXELS_API_KEY>
in the Authorization
header with your actual Pexels API key.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
).Document ID
in Google Sheets nodes) has a sheet named Sheet1
(or update the Sheet Name
parameter).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
.Form Trigger: Select Action
will provide a webhook URL to initiate the process.Customization ideas
Use cases