AI Blog Automation Agent: From Google Sheet to Published Post
Integrates with:
Overview
Unlock Automated Content Creation & Publishing with this AI Agent
Streamline your content marketing with this powerful n8n workflow. It acts as an intelligent agent that reads your content schedule and configuration from a Google Sheet, uses an AI model (like OpenAI's GPT) to generate blog posts through various configurable stages (e.g., idea, draft, final version), and then automatically publishes the finished articles to your WordPress blog. Manage your entire content calendar and AI writing instructions from one central spreadsheet.
This AI Agent empowers you to:
- Plan & Schedule: Use Google Sheets to outline topics, keywords, desired actions (e.g., draft, publish), and publication dates.
- AI-Powered Writing: Leverage Language Models for various writing tasks, from brainstorming ideas and creating outlines to drafting full articles and refining them.
- Automated Publishing: Send finalized content directly to WordPress, complete with titles and formatted text.
- Track Progress: Log all actions and outcomes back into your Google Sheet for easy monitoring.
Key Features & Benefits
- Centralized Content Management: Uses Google Sheets as a single source of truth for your blog schedule, prompts, and configurations.
- AI-Driven Content Generation: Employs an LLM (configurable via an OpenAI-compatible node, e.g., using OpenRouter) for creative and efficient content creation at multiple stages.
- Customizable Writing Process: Define different AI prompts and models for various content generation steps (e.g., idea generation, drafting, finalization) directly in your Google Sheet.
- Scheduled & Manual Operation: Can be run on a schedule to process due tasks or triggered manually for on-demand content creation.
- Direct WordPress Integration: Publishes content to WordPress via XMLRPC, handling post creation seamlessly.
- Comprehensive Logging: Keeps a detailed log of operations and their status in your Google Sheet.
- Placeholder Replacement: Dynamically inserts data from your Google Sheet into AI prompts for highly contextualized content.
- Robust Error Handling: Includes logic to parse and log responses from WordPress, indicating success or errors.
Use Cases
- B2C E-commerce: Automate the creation and publishing of SEO-optimized product highlight posts, buying guides, or lifestyle content related to your offerings to drive organic traffic and customer engagement.
- B2B SaaS: Streamline the production of feature announcements, industry analysis articles, case studies, or thought leadership pieces to establish expertise, generate leads, and educate your audience.
- Solopreneurs & Founders: Effortlessly scale content output for your personal brand or business blog, maintaining a consistent publishing schedule without needing a large content team.
- Marketing Agencies: Manage and automate blog content creation for multiple clients efficiently, using separate Google Sheet configurations for each.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- OpenAI API Key or credentials for an OpenAI-compatible service like OpenRouter (the template uses OpenRouter credentials for the
AgentLLM
node). - Google Workspace account with Google Sheets API enabled and OAuth2 credentials configured in n8n.
- A WordPress site with XMLRPC enabled, along with a WordPress username and an Application Password.
- A Google Sheet set up with three tabs: 'Schedule', 'Config', and 'Log'. See Setup Instructions for column details.
Setup Instructions
- Download the n8n workflow JSON file.
- Import the workflow into your n8n instance.
- Configure the 'Settings' Node: Fill in your Google Spreadsheet URL, WordPress subdomain (e.g.,
yourblog.wordpress.com
), WordPress username, and WordPress Application Password. Also, verify the sheet names match your setup (default:Schedule
,Config
,Log
). - Set up Credentials:
- Ensure your Google Sheets credentials (OAuth2) are correctly configured in all Google Sheets nodes:
Schedule
,fetchConfig
,SaveBackToSheet
,LogStatus
,LogPublished
,SetToPublish
. - In the
AgentLLM
node, configure your OpenAI API credentials (or OpenRouter, as per the template's default).
- Ensure your Google Sheets credentials (OAuth2) are correctly configured in all Google Sheets nodes:
- Prepare Your Google Sheet:
- 'Schedule' Sheet: Create columns like
ID
,Topic
,Scheduled
(yyyy-MM-dd HH:mm:ss format),Status
,Action
(e.g., 'idea', 'draft', 'final', 'publish'),Context
,Idea
,Content
,Title
,Draft
,Final
, and any other fields you wish to use as placeholders or for AI generation (e.g.,Length
,Keywords
). Therow_number
column will be automatically managed by n8n for updates. - 'Config' Sheet: Set up Key-Value pairs. Keys should follow patterns like
prompt_ACTION
(e.g.,prompt_draft
),prompt_ACTION_model
(e.g.,prompt_draft_model
),prompt_ACTION_outputFormat
. TheValue
will be your actual prompt, model name, or expected output format (e.g., 'json'). - 'Log' Sheet: Create columns:
Date
,Type
,Message
.
- 'Schedule' Sheet: Create columns like
- Customize Prompts: Populate the 'Config' sheet with your desired AI prompts and model preferences for each action/stage of content creation.
- Review Placeholders: The 'PreparedData' node uses
{{ placeholder }}
syntax. Ensure your prompts in the 'Config' sheet and data in the 'Schedule' sheet align with this for dynamic content generation. - Activate the workflow. You can trigger it manually using the 'ManualTrigger' node or let it run on the schedule defined in the 'ScheduleTrigger' node.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation