Skip to main content

Send a weekly AI‐written WordPress blog digest via Gmail using GPT-4o

Workflow preview

Workflow preview
100%
Send a weekly AI‐written WordPress blog digest via Gmail using GPT-4o preview
Open on n8n.io

1. Workflow Overview

Who is this for This template is built for small business owners, content marketers, and agencies who publish regularly to a WordPress blog and want to automatically surface that content as a polis...

Best for

  • Social Media automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.httprequest, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.gmail, n8n-nodes-base.googlesheets

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by AI Solutions.

Original n8n.io source

1.1 Workflow description

Title
Send a weekly AI‐written WordPress blog digest via Gmail using GPT-4o
Workflow name
Send a weekly AI‐written WordPress blog digest via Gmail using GPT-4o

Who is this for

This template is built for small business owners, content marketers, and agencies who publish regularly to a WordPress blog and want to automatically surface that content as a polished weekly email digest — without manual curation or copywriting. If you have a WordPress site, an OpenAI API key, and a Gmail account, you can have this running in under 30 minutes.

What it does

The workflow runs every Monday morning and fully automates your newsletter pipeline: it fetches your latest blog posts, uses GPT-4o to write professional summaries, renders everything into a responsive branded HTML email, then delivers it to every subscriber on your list.

How it works

A Schedule Trigger fires once a week (Monday at 10 AM by default) to kick off the pipeline.

Fetch WP Posts calls the WordPress REST API to retrieve posts published in the last 7 days, requesting up to 20 results with embedded featured media in a single request — no separate media lookups needed.

Process Posts is a Code node that normalizes the raw WordPress API response into clean article objects. It extracts titles, excerpts, URLs, featured image URLs, categories, and publish dates; strips HTML tags and decodes entities; de-duplicates by URL; and returns the top 12 articles sorted newest-first.

AI — Generate Summaries is a LangChain AI Agent backed by GPT-4o. It receives the structured article list and returns a JSON payload containing a 3–5 sentence professional summary for each article plus a short weekly overview paragraph. Image and article URLs are passed through unchanged — the prompt explicitly instructs the model not to modify them.

Format HTML Email renders the AI output into a fully responsive, table-based HTML email. The layout includes a branded header with logo, a weekly overview callout block, individual article cards with featured images, a CTA button, and a footer with unsubscribe link. All brand variables (site name, logo URL, colors, CTA link) are defined as named constants at the top of the Code node for easy customization.

Get Subscribers retrieves your mailing list from a Google Sheets worksheet. This node can be swapped for any other list source — Excel, Airtable, a CRM — with no changes needed downstream.

Check Valid Email filters out any subscriber records that are missing an email address before delivery. Records without a valid email exit silently on the FALSE branch.

Send Newsletter loops through each valid subscriber and delivers the HTML email via Gmail, with the newsletter date dynamically inserted in the subject line.

How to set up

  1. In Fetch WP Posts, replace YOUR-WORDPRESS-SITE.com with your WordPress domain.
  2. In LLM — GPT-4o, select your OpenAI API credential.
  3. In Format HTML Email, update the constants at the top of the Code node: SITE_NAME, SITE_URL, LOGO_URL, CTA_URL, and CTA_TEXT.
  4. In Get Subscribers, update the Worksheet and table name. Swap the node entirely if your subscriber list lives elsewhere.
  5. In Send Newsletter, select your Gmail OAuth2 credential and update the senderName option.
  6. Optionally adjust the send day and time in Weekly Schedule.

Requirements

  • WordPress site with the default REST API enabled (no plugin required for posts)
  • Google Sheet or alternative source for your subscriber list
  • OpenAI API key
  • Gmail account with OAuth2 configured in n8n
  • Self-hosted n8n — this workflow uses @n8n/n8n-nodes-langchain (AI Agent + OpenAI Chat Model), which requires a self-hosted instance

How to customize the workflow

  • Post window — Change days: 7 in the after query parameter of Fetch WP Posts to cover a longer or shorter period.
  • Article count — Update articles.slice(0, 12) in Process Posts and the matching slice in the AI prompt to show more or fewer articles per issue.
  • AI model — Swap GPT-4o for GPT-4o-mini or GPT-4.1 in the LLM — GPT-4o sub-node to adjust quality vs. cost.
  • Brand styling — All colors, fonts, logo, and layout are controlled inside the Format HTML Email Code node. The HTML uses table-based layout for broad email client compatibility including Outlook.
  • Subscriber source — Replace Get Subscribers with our Wordpress API (paid version), Airtable, HubSpot, or any other n8n-supported node. Map the email field and the rest of the workflow requires no changes.
  • Send frequency — Change the Schedule Trigger to bi-weekly, monthly, or any custom cron expression.
  • Email service — Replace the Gmail node with Outlook, SendGrid, Mailgun, or any SMTP-compatible service supported by n8n.

Visit automatedintelligentsolutions.com for more information and workflows.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - 📋 Workflow Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Section — Fetch & Process

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Section — AI Summarisation

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Section — Subscriber Delivery

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - ⚠️ Community / LangChain Nodes

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Weekly Schedule

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 7 - Fetch WP Posts

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Process Posts

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - LLM — GPT-4o

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 10 - AI — Generate Summaries

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 11 - Format HTML Email

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Send Newsletter

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 13 - Get Subscribers

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

3. Summary Table

Workflow Send a weekly AI‐written WordPress blog digest via Gmail using GPT-4o
Complexity intermediate
Nodes 13
Categories Social Media, AI Summarization
Author AI Solutions
Published 29 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15392/15392.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send a weekly AI‐written WordPress blog digest via Gmail using GPT-4o do?

Who is this for This template is built for small business owners, content marketers, and agencies who publish regularly to a WordPress blog and want to automatically surface that content as a polis...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, AI Summarization use case.