AutomationFlowsAI & RAG › Auto-generate Tech News Blog Posts with NewsAPI & Gemini

Auto-generate Tech News Blog Posts with NewsAPI & Gemini

Original n8n title: Auto-generate Tech News Blog Posts with Newsapi & Google Gemini to Wordpress

ByDavid Olusola @dae221 on n8n.io

Overview: This automation automatically fetches trending tech news every morning, uses AI to create engaging blog posts from each article, and publishes them directly to your WordPress site.

Cron / scheduled trigger★★★★☆ complexityAI-powered9 nodesHTTP RequestAgentGoogle Gemini ChatWordPress
AI & RAG Trigger: Cron / scheduled Nodes: 9 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7397 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ba65f2c4-f38e-407c-87d8-5540a98ce6e3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -176
      ],
      "parameters": {
        "width": 2092,
        "height": 588,
        "content": "## Daily News Digest Automation\n\n**What it does:**\n- Fetches top tech news every day at 8 AM\n- AI summarizes and creates engaging blog post\n- Auto-publishes to WordPress\n\n**Setup Required:**\n1. Get free NewsAPI key from newsapi.org\n2. Replace YOUR_API_KEY in the HTTP Request URL with your actual key\n3. Configure WordPress credentials in the WordPress node\n4. Set up Google Gemini API credentials for AI agent\n\n**Customization:**\n- Change schedule time in trigger (currently 8 AM daily)\n- Modify news sources/categories in URL parameters\n- Adjust AI prompt for different writing styles\n- Change post status from \"publish\" to \"draft\" for review\n\n**Need Help?**\nFor [n8n coaching or one-on-one consultation:](mailto:david@daexai.com)"
      },
      "typeVersion": 1,
      "Google Gemini Chat Model": {
        "ai_languageModel": [
          [
            {
              "node": "AI News Summarizer",
              "type": "ai_languageModel",
              "index": 0
            }
          ]
        ]
      }
    },
    {
      "id": "8f0b8ffe-e898-4d43-8b67-1ebe60c2e3a6",
      "name": "Daily 8AM Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        128,
        48
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f002cec0-eee4-457e-9b81-81b1bc4cf8aa",
      "name": "Fetch Tech News",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        48
      ],
      "parameters": {
        "url": "https://newsapi.org/v2/top-headlines?apiKey=YOUR_TOKEN_HERE&country=us&category=technology&pageSize=10",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "country",
              "value": "us"
            },
            {
              "name": "pageSize",
              "value": "10"
            },
            {
              "name": "category",
              "value": "technology"
            }
          ]
        },
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "8a7b5502-fa7f-4a19-ba44-f0da9fb71f10",
      "name": "AI News Summarizer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        992,
        48
      ],
      "parameters": {
        "text": "=You are a tech news writer. Based on the article provided, write an engaging blog post.\n\nReturn ONLY valid JSON in this exact format:\n{\n  \"title\": \"Your catchy headline here\",\n  \"content\": \"Full blog post content with proper formatting\"\n}\n\nArticle details:\n- Title: {{ $json.title }}\n- Description: {{ $json.description }}\n- Content: {{ $json.content }}\n- Source: {{ $json.source }}\n\nWrite a 600-800 word blog post expanding on this article.",
        "options": {
          "systemMessage": "You are a tech news curator. Create a compelling blog post that summarizes the top tech news stories. Format it with proper headings, bullet points, and include brief commentary on each story's significance. Make it engaging and informative for a general tech audience."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "4006ddaa-e0ae-4b88-9ed8-bf83a7c6dce3",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1072,
        272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "446986b0-41ee-43c0-bec0-58db6c6530c0",
      "name": "Publish to WordPress",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        1488,
        48
      ],
      "parameters": {
        "title": "={{ $json.title }}",
        "additionalFields": {
          "tags": [
            "technology",
            "news",
            "daily",
            "automation"
          ],
          "status": "publish",
          "content": "={{ $json.content }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bc06c085-5fa9-495c-ad5c-0cfe0c0cd500",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        768,
        48
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "97aa2d40-ad65-4570-bcda-45d13c67c07f",
      "name": "Title and Content",
      "type": "n8n-nodes-base.code",
      "position": [
        1264,
        48
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nreturn items.map(item => {\n  // Remove markdown code blocks and parse JSON\n  let aiOutput = item.json.output;\n  \n  // Remove ```json and ``` markers\n  aiOutput = aiOutput.replace(/```json\\s*/, '').replace(/```\\s*$/, '');\n  \n  // Parse the cleaned JSON\n  const parsedOutput = JSON.parse(aiOutput.trim());\n  \n  return {\n    json: {\n      title: parsedOutput.title,\n      content: parsedOutput.content,\n      originalTitle: item.json.title,\n      source: item.json.source,\n      url: item.json.url\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "ac0c85f6-d554-40c0-8cd2-a5869367cb5a",
      "name": "Split Articles",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        48
      ],
      "parameters": {
        "jsCode": "// Split the articles array and clean up the data\nconst articles = $input.first().json.articles;\n\n// Filter out articles with null/missing content and limit to top 5\nconst validArticles = articles\n  .filter(article => \n    article.title && \n    article.description && \n    article.content && \n    article.content !== \"[Removed]\"\n  )\n  .slice(0, 5); // Limit to 5 articles to avoid rate limits\n\n// Return each article as a separate item\nreturn validArticles.map(article => ({\n  json: {\n    title: article.title,\n    description: article.description,\n    content: article.content,\n    url: article.url,\n    urlToImage: article.urlToImage,\n    publishedAt: article.publishedAt,\n    source: article.source.name\n  }\n}));"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Split Articles": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Tech News": {
      "main": [
        [
          {
            "node": "Split Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "AI News Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily 8AM Trigger": {
      "main": [
        [
          {
            "node": "Fetch Tech News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Title and Content": {
      "main": [
        [
          {
            "node": "Publish to WordPress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI News Summarizer": {
      "main": [
        [
          {
            "node": "Title and Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish to WordPress": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI News Summarizer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Overview: This automation automatically fetches trending tech news every morning, uses AI to create engaging blog posts from each article, and publishes them directly to your WordPress site.

Source: https://n8n.io/workflows/7397/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty

Telegram, Google Sheets Trigger, Agent +26
AI & RAG

This workflow automates the process of creating technical tutorials for your blog. It runs on a weekly schedule, automatically identifies trending GitHub repositories, uses an AI to generate a detaile

HTTP Request, Agent, Google Gemini Chat +2
AI & RAG

Complete PostgreSQL-backed system: Keyword scoring → AI research → Multi-part content generation → fal.ai Nano Banana image generation → WordPress publishing

WordPress, OpenAI, Perplexity +8
AI & RAG

LinkedIn_Job_Hunt_and_Cover_Letter. Uses outputParserStructured, outputParserAutofixing, googleDrive, agent. Scheduled trigger; 85 nodes.

Output Parser Structured, Output Parser Autofixing, Google Drive +6
AI & RAG

We’ve released Version 4 of our AI Powered Blog Automation workflow. We heard your complains and made a complete redesign built for serious content creators.

RSS Feed Read, OpenAI Chat, Text Classifier +6