Google Sheets to WordPress, drafts with images ready
Your content pipeline probably isn’t “writing.” It’s hunting for topics, copying briefs into docs, juggling versions, then realizing you still need a featured image before anything can go live. That’s how a simple post turns into a half-day of busywork.
Content marketers feel it when the calendar slips. Agency owners feel it when clients want “more output” without more budget. Even a solo founder trying to stay visible gets stuck. This Sheets WordPress drafts automation turns trends into review-ready drafts (with images) without turning your week into tab-hopping.
You’ll see how the workflow finds a trending topic, logs it in Google Sheets, generates a full draft, then uploads an AI image and assigns it as the featured media in WordPress.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Google Sheets to WordPress, drafts with images ready
flowchart LR
subgraph sg0["When clicking 'Execute workflow' Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking 'Execute workf..", pos: "b", h: 48 }
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Parse Content from string to.."]
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/wordpress.svg' width='40' height='40' /></div><br/>Create a post"]
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Update name and extension of.."]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Upload image to WP media Lib.."]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Assign image to an article a.."]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/perplexity.dark.svg' width='40' height='40' /></div><br/>Find top trending topics"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Select a clean trending topic"]
n8@{ icon: "mdi:database", form: "rounded", label: "Add topic to Google Sheets", pos: "b", h: 48 }
n9@{ icon: "mdi:database", form: "rounded", label: "Get most recent topics from ..", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/perplexity.dark.svg' width='40' height='40' /></div><br/>Generate content and image p.."]
n11@{ icon: "mdi:database", form: "rounded", label: "Update Google Sheet with gen..", pos: "b", h: 48 }
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Generate featured image usin.."]
n2 --> n12
n6 --> n7
n8 --> n9
n7 --> n8
n4 --> n5
n0 --> n6
n1 --> n11
n3 --> n4
n9 --> n10
n11 --> n2
n12 --> n3
n10 --> n1
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n8,n9,n11 database
class n4,n5,n12 api
class n1,n3,n7 code
classDef customIcon fill:none,stroke:none
class n1,n2,n3,n4,n5,n6,n7,n10,n12 customIcon
The Problem: Drafting content is the easy part
Most teams don’t struggle because they can’t write. They struggle because “publish a post” is actually 15 tiny tasks spread across tools. Someone has to pick a topic that’s worth writing about, keep a backlog you can trust, generate or outline content, format it for WordPress, then deal with images and metadata. And the moment you skip any step, quality drops or things ship half-finished. Honestly, that’s where consistency dies: not in creativity, but in process.
The friction compounds, especially once you’re trying to do this every week.
- Trending topics get discussed in Slack or meetings, then vanish because there’s no queue.
- Drafts end up inconsistent, since every writer starts from a different template.
- Featured images become a last-minute scramble, so posts sit in “almost ready” status.
- Copy-paste formatting into WordPress introduces weird spacing, broken headings, and avoidable edits.
The Solution: A tracked pipeline from trend → WordPress draft
This n8n workflow creates a simple, repeatable content machine using tools you probably already understand. You launch it, and Perplexity AI scans the last day or two of developer and security news to surface a topic that’s actually trending. That topic gets cleaned up, then written into a Google Sheet so you have a living queue instead of scattered notes. Next, Perplexity generates the post itself (title, sections, keywords, and meta description), and the workflow converts that output into structured data your tools can use. From there, n8n creates a WordPress draft for review, generates a featured image via HuggingFace FLUX, uploads the image to WordPress Media, and attaches it to the draft automatically. No publishing without approval. You stay in control.
The workflow starts with trend discovery and a clean backlog in Google Sheets. Then it generates content and creates a WordPress draft. Finally, it produces an AI image, uploads it, and sets it as the featured media so the post looks complete when you open WordPress.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you want 3 new drafts a week. Manually, a typical cycle might look like 30 minutes to find and validate a topic, about 2 hours to outline and write, then another 30 minutes to format in WordPress and hunt down an image. Call it about 3 hours per post, or roughly 9 hours a week. With this workflow, the “human time” becomes launching the run and reviewing the draft, maybe 15 minutes per post, while generation and image creation happen in the background. You still approve everything, but you’re no longer doing the mechanical parts.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets for the topic queue and tracking.
- WordPress to store drafts and upload media.
- HuggingFace API token (get it from your HuggingFace account settings).
Skill level: Intermediate. You’ll connect accounts, edit a sheet ID and site URL, and paste API tokens.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
Manual launch kicks it off. You run the workflow when you want new topics and drafts generated. Some teams do this daily, others batch it twice a week.
Trend discovery and cleanup happen first. Perplexity AI finds a hot topic from the last 24–48 hours, then a small cleanup step turns it into something you’d actually want as a post headline or working title.
Google Sheets becomes your content control center. The workflow appends the topic to your sheet, pulls any pending rows, generates the full post (title, content sections, keywords, meta description), then writes that back to the same row so the status is always visible.
WordPress draft and featured image get created automatically. n8n publishes the content as a draft through the WordPress REST API, generates an image with HuggingFace FLUX, uploads it to Media, then sets that image as the featured media on the draft.
You can easily modify the Google Sheet columns to match your editorial workflow, so you can add things like “reviewer,” “category,” or “internal links” later. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Set up the manual trigger that starts the workflow and launches the trending topic discovery process.
- Add the Manual Workflow Launch node as your trigger.
- Keep default settings (no parameters required).
- Connect Manual Workflow Launch to Discover Trending Topics to follow the execution flow.
Step 2: Connect Google Sheets
Configure Google Sheets to store and retrieve topics and generated content.
- Open Append Topic to Sheets and set Operation to
append. - Set Document to
[YOUR_ID]and Sheet Name toSheet1. - Map Topic to
{{ $json.snippet }}and is_generated to0. - Open Retrieve Pending Topics and set the filter to is_generated equals
0. - Open Update Sheet with Content and keep Operation set to
update. - Ensure matching column is row_number and keep the mapped expressions such as
{{ $json.data.title }}and{{ $json.data.additional_elements.meta_description }}. - Credential Required: Connect your Google Sheets credentials in Append Topic to Sheets, Retrieve Pending Topics, and Update Sheet with Content.
[YOUR_ID] isn’t replaced with your actual spreadsheet ID, the workflow will fail on the first Sheets operation.Step 3: Set Up Perplexity AI Content Generation
Configure the AI steps that discover trends and generate structured blog content.
- In Discover Trending Topics, keep the provided message prompt as-is to return clean JSON.
- In Create Content & Image Prompt, set Model to
sonar-proand keep the message template with{{ $json.Topic }}and{{ $json.row_number }}. - Credential Required: Connect your Perplexity credentials in Discover Trending Topics and Create Content & Image Prompt.
Step 4: Configure Processing Logic
These code nodes clean and structure the AI outputs for reliable downstream use.
- Keep the JavaScript in Pick Clean Trend unchanged to randomly select a trend from
search_results. - Ensure Convert Text to JSON parses the AI response with
return parseJSONString($input.first().json.choices[0].message.content);. - Connect the flow: Discover Trending Topics → Pick Clean Trend → Append Topic to Sheets → Retrieve Pending Topics → Create Content & Image Prompt → Convert Text to JSON.
Step 5: Configure WordPress Draft and Media Upload
Create a draft post and attach an AI-generated featured image via HTTP requests to WordPress.
- In Generate WordPress Draft, set Title to
{{ $json.title }}and Content to{{ $json.content }}; keep Status asdraftand Author ID as4. - Credential Required: Connect your WordPress credentials in Generate WordPress Draft.
- In Produce Featured Image, set URL to
https://router.huggingface.co/hf-inference/models/black-forest-labs/FLUX.1-schnelland keep the JSON body{ "inputs": "{{ $('Convert Text to JSON').item.json.data.image_prompt }}" }. - Replace the Authorization header value in Produce Featured Image with your token:
Bearer [CONFIGURE_YOUR_TOKEN]. - Keep Fix Image Filename unchanged to set
generated-image.jpgwithimage/jpegmetadata. - In Upload Image to WP Media, set URL to
https://your-site.com/wp-json/wp/v2/mediaand keep Authentication aspredefinedCredentialTypewith Credential TypewordpressApi. - In Set Featured Media on Post, set URL to
https://your-site.com/wp-json/wp/v2/posts/{{ $('Generate WordPress Draft').item.json.id }}and keep JSON body{ "featured_media": {{ $json.id }} }. - Credential Required: Connect your WordPress API credentials in Upload Image to WP Media and Set Featured Media on Post.
https://your-site.com unchanged, media upload and featured image assignment will fail.Step 6: Test and Activate Your Workflow
Run a full test to confirm data flows from trend discovery to WordPress draft creation.
- Click Execute Workflow starting from Manual Workflow Launch.
- Verify that Append Topic to Sheets adds a new row with is_generated set to
0. - Confirm Update Sheet with Content updates the same row using the row_number match.
- Check WordPress for a new draft created by Generate WordPress Draft and a featured image set by Set Featured Media on Post.
- Once validated, toggle the workflow to Active for production use.
Common Gotchas
- Google Sheets credentials can expire or need specific permissions. If things break, check the connected Google account and the n8n credential permissions first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- WordPress REST API calls often fail because the user role can’t upload media. Confirm your WordPress user (the authorId you set) has Media upload permissions and that application passwords are enabled.
Frequently Asked Questions
About an hour if you already have the accounts and tokens.
No. You’ll mostly paste credentials and update a few values like your sheet ID and WordPress author ID.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Perplexity API usage and HuggingFace image generation costs.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but expect a little tweaking. The easiest place to change format is the Perplexity “Create Content & Image Prompt” step, because that’s where the structure (headings, sections, keywords, meta) is defined. You can also adjust the “Convert Text to JSON” logic if you add new fields like category, slug, or internal links. Common customizations are swapping “developer/security” for your niche, changing the section template, and writing a stricter image prompt so featured images match your brand.
Usually it’s an application password issue or the user doesn’t have permission to create posts or upload media. Regenerate your WordPress application password, update the credentials in n8n, and double-check the authorId points to a real user. If drafts create fine but images fail, it’s almost always a Media upload permission or a security plugin blocking REST requests.
If you self-host n8n, it mostly depends on your server and the API rate limits. On n8n Cloud, your cap depends on the plan’s monthly executions, so high-volume sites usually move up a tier. In practice, many teams run this in batches of 5–20 topics so Sheets stays clean and WordPress doesn’t fill up with low-priority drafts. If you’re generating lots of posts daily, watch Perplexity and HuggingFace limits first.
Often, yes. This workflow needs branching logic (only generate for pending rows), structured transformations (turn AI text into JSON fields), and multi-step media handling with the WordPress REST API, and those pieces can get awkward or expensive in simpler tools. n8n also gives you the self-hosted option, which matters once you’re doing lots of drafts. Zapier or Make can still be fine for a lightweight “Sheet row → create draft” flow, just not as comfortable for end-to-end content plus images. If you want help choosing, Talk to an automation expert.
Set this up once, and your backlog turns into drafts that are actually ready to review. The workflow handles the repetitive stuff. You handle the judgment calls.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.