Perplexity to WordPress, posts published and logged
Your content plan usually doesn’t fail because of “ideas.” It fails because turning an idea into a published post takes too many little steps, and they always land on the same already-full week. Perplexity WordPress automation fixes that.
Marketing managers feel it when “weekly posting” becomes a monthly scramble. A solo founder feels it when publishing slips behind product and sales. And an agency lead? They feel it every time a client asks, “What went live this week?”
This workflow researches a topic, writes the article, generates a featured image, publishes to WordPress, and logs the result in Google Sheets. You’ll see what it does, what you need, and where teams usually tweak it.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Perplexity to WordPress, posts published and logged
flowchart LR
subgraph sg0["Schedule Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Schedule Trigger", 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/httprequest.dark.svg' width='40' height='40' /></div><br/>Research Topic- Perplexity"]
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/httprequest.dark.svg' width='40' height='40' /></div><br/>Crear Post en Wordpress"]
n3@{ icon: "mdi:robot", form: "rounded", label: "Message a model", pos: "b", h: 48 }
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 Wordpress"]
n5@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n6@{ icon: "mdi:cog", form: "rounded", label: "Wait", pos: "b", h: 48 }
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/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Leonardo Image Status"]
n8["<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/>Get Leonardo Image"]
n9["<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/>Agregar ALT a la Imagen"]
n10@{ icon: "mdi:database", form: "rounded", label: "Publicaciones Wordpress Star..", pos: "b", h: 48 }
n11["<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/>Leonardo: Create Post Image"]
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/code.svg' width='40' height='40' /></div><br/>Get Title, Content, and Imag.."]
n5 --> n8
n5 --> n6
n6 --> n7
n3 --> n11
n0 --> n1
n8 --> n4
n9 --> n2
n2 --> n10
n7 --> n5
n4 --> n9
n1 --> n12
n11 --> n7
n12 --> n3
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 n3 ai
class n5 decision
class n10 database
class n1,n2,n4,n7,n8,n9,n11 api
class n12 code
classDef customIcon fill:none,stroke:none
class n1,n2,n4,n7,n8,n9,n11,n12 customIcon
The Problem: Weekly publishing dies in the handoff
Publishing consistently sounds simple until you do the whole chain yourself. You research a topic, collect sources, outline, draft, find an image, rename it, upload it, add alt text, format HTML so it doesn’t break, then finally hit publish. And after that, you still need a place to track what went live, which category it used, and what URL to share. Miss one step and you either ship something sloppy or you delay again. Honestly, it’s the switching between tools that drains you.
It’s rarely one big blocker. The friction compounds.
- Topic research gets repeated because last week’s notes are scattered across tabs, docs, and messages.
- Formatting and uploading to WordPress takes about 30 minutes per post, even when the writing is already done.
- Featured images become a mini-project, which means posts sit “almost ready” for days.
- Tracking happens after the fact, so you lose links, categories, and publishing history when you need it most.
The Solution: Perplexity research → AI draft → WordPress publish + Sheets log
This n8n workflow runs on a schedule every Monday morning and builds a complete blog post end-to-end. It starts by calling Perplexity to pull a timely startup topic (and the supporting context you’d normally hunt down manually). Then it extracts the key fields it needs and uses GPT to generate an SEO-friendly article in structured HTML, so WordPress formatting is less of a gamble. Next, it creates an image prompt, requests a cinematic featured image from Leonardo AI, waits until the render is ready, and downloads the final asset. Finally, it uploads the image to WordPress, applies alt text, publishes the post in your chosen category, and logs the URL and metadata into Google Sheets so you have a clean history.
The workflow begins with a weekly CRON trigger. From there, Perplexity + GPT handle the research and writing while Leonardo produces the image in the background. WordPress receives a finished post and Google Sheets becomes your tracking dashboard, automatically.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you publish one SEO post every week. Manually, you might spend about 45 minutes researching, about 60 minutes turning a draft into clean WordPress HTML, and another 20 minutes finding or generating an image, uploading it, and setting alt text. That’s roughly 2 hours per post, plus the annoying context switching. With this workflow, you spend about 10 minutes reviewing the draft and tweaking the category or headline, then it publishes and logs the URL automatically.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Perplexity API for topic research and sources
- OpenAI API to generate the HTML article
- Leonardo AI token (get it from your Leonardo account settings)
- WordPress credentials (Basic Auth from your WordPress setup)
- Google Sheets access to log published posts
Skill level: Intermediate. You will connect APIs, paste keys, and verify WordPress endpoints, but you won’t be writing an app.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A weekly schedule triggers the run. Every Monday at 6:00 AM, n8n starts the workflow automatically, so content production isn’t stuck behind meetings or inbox triage.
Perplexity pulls a trend-worthy topic. An HTTP request asks Perplexity for trending startup ideas and returns research context you can build on instead of starting from a blank page.
The workflow turns research into a publishable post. A code step extracts the fields you care about, then GPT generates a structured HTML article. Another AI step creates a strong image prompt, and Leonardo renders the featured image while n8n checks status and waits if it’s not ready yet.
WordPress gets the final assets and Google Sheets gets the record. The workflow uploads the image, applies alt text, publishes the post in your chosen category, then logs key details to a Sheets row so you can track output over time.
You can easily modify the publishing day to match your editorial calendar based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Scheduled Trigger
Set the weekly schedule that starts the pipeline.
- Add the Scheduled Automation Start node as your trigger.
- Set the cron expression to
0 6 * * 1in the rule interval to run every Monday at 06:00. - Connect Scheduled Automation Start to Retrieve Topic via Perplexity.
Step 2: Connect Perplexity for Article Generation
Pull a fresh, structured article in JSON format from Perplexity.
- Select the Retrieve Topic via Perplexity node.
- Credential Required: Connect your perplexityApi credentials.
- Credential Required: Connect your httpHeaderAuth credentials.
- Set URL to
https://api.perplexity.ai/chat/completionsand Method toPOST. - Set JSON Body to the provided JSON prompt payload that returns
titleandcontentin strict JSON. - Connect Retrieve Topic via Perplexity to Extract Article Fields.
Step 3: Parse the Article and Generate the Image Prompt
Transform the Perplexity output into structured fields and prepare an editorial image prompt.
- Open Extract Article Fields and keep the JavaScript that parses
choices[0].message.contentand buildsimage_filename. - Confirm the output fields are title, content, and image_filename.
- Open Generate Image Prompt and set the model to
gpt-4.1-mini. - Credential Required: Connect your openAiApi credentials.
- Ensure the prompt references
{{ $json.title }}and{{ $json.content }}to build the image description. - Connect Extract Article Fields to Generate Image Prompt.
Step 4: Generate and Retrieve the Leonardo Image
Request the image, poll for completion, and download the final asset.
- In Request Leonardo Image, set URL to
https://cloud.leonardo.ai/api/rest/v1/generationsand keep the JSON body with"prompt": "{{ $json.message.content }}". - Credential Required: Connect your httpBearerAuth credentials in Request Leonardo Image and Check Leonardo Status.
- In Check Leonardo Status, set the URL to
=https://cloud.leonardo.ai/api/rest/v1/generations/{{ $json.sdGenerationJob.generationId }}. - Configure Status Branch Check to check
{{ $json.generations_by_pk.status }}equalsCOMPLETE. - Ensure Status Branch Check routes to Fetch Leonardo Image when complete, and to Delay Interval when not complete.
- Connect Delay Interval back to Check Leonardo Status to create the polling loop.
- In Fetch Leonardo Image, set the URL to
={{ $json.generations_by_pk.generated_images[0].url }}.
Step 5: Publish to WordPress and Log to Sheets
Upload the image, set alt text, publish the post, and record it in Google Sheets.
- In Upload Media to WordPress, set URL to
https://cristiantala.com/wp-json/wp/v2/mediaand Content Type tobinaryData. - Set the header Content-Disposition to
=attachment; filename="{{ $('Extract Article Fields').item.json.image_filename }}"and Content-Type toimage/jpeg. - Credential Required: Connect your httpBasicAuth credentials for Upload Media to WordPress, Apply Image Alt Text, and Publish WordPress Post.
- In Apply Image Alt Text, set URL to
=https://cristiantala.com/wp-json/wp/v2/media/{{ $json.id }}and set alt_text to{{ $('Generate Image Prompt').item.json.message.content }}. - In Publish WordPress Post, set the JSON body to include
"title": "{{ $('Extract Article Fields').item.json.title }}","content": "{{ $('Extract Article Fields').item.json.content }}","status": "publish","categories": [916], and"featured_media": {{ $('Upload Media to WordPress').item.json.id }}. - In Log Post to Sheets, set Operation to
appendOrUpdate, select the spreadsheet[YOUR_ID], and map columns likeURL,Topic, andFecha del Posteo. - Credential Required: Connect your googleSheetsOAuth2Api credentials in Log Post to Sheets.
Step 6: Test and Activate Your Workflow
Run a manual execution to verify the full pipeline before letting it run on schedule.
- Click Execute Workflow and confirm that Retrieve Topic via Perplexity returns JSON with
titleandcontent. - Verify Request Leonardo Image and Check Leonardo Status loop until Status Branch Check routes to Fetch Leonardo Image.
- Confirm Upload Media to WordPress returns a media
idand that Publish WordPress Post returns a published post. - Open the Google Sheet to verify Log Post to Sheets appended or updated the row with the new post URL and image URL.
- Toggle the workflow to Active so Scheduled Automation Start runs it automatically every week.
Common Gotchas
- WordPress credentials can expire or need specific permissions. If things break, check your WordPress application password or Basic Auth settings 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.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About an hour if you already have all API keys.
No coding required. You’ll mainly connect accounts, paste API keys, and test a manual run.
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, OpenAI, and Leonardo API usage 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 you’ll want to change it in the prompts, not at the end. Update the “Retrieve Topic via Perplexity” request to fetch Spanish-language sources, then adjust the GPT prompt so it writes in Spanish with your preferred tone. If you need Spanish alt text too, keep that instruction in the image/alt-text part of the workflow so it stays consistent. Category IDs in WordPress can also be swapped to route Spanish posts into a dedicated category.
Usually it’s invalid Basic Auth credentials or an endpoint mismatch. Regenerate your WordPress application password (or confirm Basic Auth is allowed), then update the credentials used in the HTTP requests for media upload and post publishing. Also check that your site blocks XML-RPC/REST requests from unknown IPs, which can silently fail on some hosts. If media uploads work but publishing fails, it’s often a permissions issue for the user role tied to the credentials.
Practically, it can handle as many as your n8n plan and API quotas allow.
Often, yes, because this workflow needs waiting, branching, and multi-step HTTP calls that get clunky (and pricey) in simpler tools. n8n handles the Leonardo “check status, wait, retry” loop cleanly, and you can self-host if you want unlimited executions. The trade-off is a bit more setup time up front. If your process is just “take text, create a draft,” Zapier or Make might be fine. If you want the full pipeline with images, publishing, and logging, n8n is a better fit. Talk to an automation expert if you want a quick recommendation based on your stack.
Once this is running, “weekly publishing” stops being a recurring task and becomes a scheduled outcome. The workflow handles the repetitive parts so you can focus on what to say next.
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.