n8n Workflow: Auto-Fetch News, AI-Rewrite, WordPress Publish
Daily at 9 AM, n8n fetches one US tech news item via NewsData.io API, rewrites it into a 5-paragraph original post using OpenAI's gpt-4.1-nano-2025-04-14, parses JSON output, and publishes directly to WordPress REST API—no code beyond one JS snippet.
Workflow Triggers Daily Tech Blog Posts Without Manual Input
Set a Schedule Trigger node in n8n to run every day at 9 AM (Days Between Triggers: 1, Hour: 9, Minute: 0). This kicks off fetching one fresh US English tech article from NewsData.io's API at https://newsdata.io/api/1/news using GET with these query parameters: apikey=pub_f10953218844a44bb0a5a8b618ef4923 (replace with yours), category=technology, language=en, country=us, size=1. Limiting to size=1 ensures one high-quality article daily, prioritizing depth over volume for consistent posting.
Connect to an OpenAI node (gpt-4.1-nano-2025-04-14 model for cost-effective quality) with credentials via your API key. Use this system prompt: "You are an expert blog writer who creates engaging, original content. You excel at transforming news into interesting articles without plagiarism." User prompt pulls news data dynamically: "Write a completely original blog post about this news: Title: Description: Requirements: - Create a unique and engaging title - Write EXACTLY 5 separate paragraphs (each in its own
tag) - Include your own analysis and perspective - Do NOT copy phrases from the original source - End with a thoughtful conclusion Format the response as clean JSON without backticks: { "title": "Your creative blog title", "content": "The full blog post content with HTML formatting including separate
tags for each paragraph" }". This structure forces originality, adds analysis, and outputs parseable JSON with HTML paragraphs, avoiding plagiarism while expanding brief news into engaging 5-para posts.
Parse AI Output and POST to WordPress for Live Publishing
Insert a Code node (JavaScript, Run Once for All Items) after OpenAI to extract clean data: const response = items[0].json.message.content; const parsed = JSON.parse(response); return [ { json: { title: parsed.title, content: parsed.content } } ];. This strips the AI response to just title and content fields, translating OpenAI's text into WordPress-compatible JSON.
Final HTTP Request node uses POST to https://yourdomain.com/wp-json/wp/v2/posts (Body Content-Type: JSON) with WordPress API authentication via application password (generate in WP admin, not regular login). Body fields: title=, content=, status=publish. Switch to "draft" for review. Activate workflow toggle for 24/7 automation; monitor via Executions tab. Fixes: Verify NewsData/OpenAI API keys/credits; regenerate WP app password for 401 errors. Get full template at https://n8nstack.gumroad.com/l/iseswo to import instantly.