AutomationFlowsAI & RAG › Create and Publish SEO Blog Posts Using Google Sheets, Gemini/openai,…

Create and Publish SEO Blog Posts Using Google Sheets, Gemini/openai,…

Original n8n title: Create and Publish SEO Blog Posts Using Google Sheets, Gemini/openai, Ideogram, and Wordpress

ByIncrementors @incrementors on n8n.io

This workflow automates the complete blog publishing process. It removes manual work from content creation, image generation, category management, and WordPress publishing by using AI and n8n. It helps agencies, SEO teams, and content creators manage blogs at scale. Scheduled or…

Cron / scheduled trigger★★★★★ complexityAI-powered46 nodesGoogle Gemini ChatOutput Parser StructuredLm Chat Deep SeekAgentHTTP RequestDiscordOpenAI ChatGoogle Sheets
AI & RAG Trigger: Cron / scheduled Nodes: 46 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Agent → Discord 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
{
  "nodes": [
    {
      "id": "3bbfc73f-a79e-47a4-8f74-08a71da79ff5",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -160,
        432
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0b88a86a-2533-474a-9dcf-dbb538f19454",
      "name": "Image Prompt Generator1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2048,
        592
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4155f7df-5420-4ce0-8844-d62519e37a73",
      "name": "Google Gemini Chat Model6",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3680,
        480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4217d275-0538-4eac-91b0-e5831447b223",
      "name": "Structured Output Parser2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2112,
        480
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n\t\"Thumbnail Prompt\": \"\",\n    \"Alt Text Thumbnail Image\" : \"\",\n\t\"Image Prompt 1\": \"\",\n    \"Alt Text Image 1\" : \"\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "371f9278-6c18-4e22-b42a-1ba33bd47f06",
      "name": "DeepSeek Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "position": [
        2336,
        576
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ab74fc63-afb7-437a-841d-222848d979c0",
      "name": "Blog and Photo Merge1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3680,
        208
      ],
      "parameters": {
        "text": "=**Blog title:** {{ $('extract_title_body').item.json.h1Only }}\n\n**Blog Images DATA in JSON**\n{{ $json.data[1].guid.rendered }}\n\n**Current Existing Article:**\n{{ $('extract_title_body').item.json.excludedH1 }}",
        "options": {
          "systemMessage": "=You are a content writer. I have a job for you.\n\nI have created an article for my WordPress website and have already uploaded the inner blog images. I have one alt text and image URL.\n\nI will also provide you with the blog title and some additional details that should be included in the article.\n\nYour task is to add those additional details into the relevant place in the article **without changing anything else**. Simply merge the additional details into the article and return the complete updated article in **HTML format**. The input format should not be modified \u2014 keep it as it is.\n\nThis contains only one image, which should be placed in the body after one or two paragraphs. The thumbnail link will not be included here; I will add it separately. Place the image in the relevant spot in the article accordingly.\n\n# Critical instructions\n\n- Do not add intro or supporting text; just return the article.\n- Do not add the blog title in the content.\n- The FAQs section should be at the end.\n- The thumbnail image must be at the top before the article starts.\n- Make sure to add the image alt text which is provided.\n- The 2nd image and 3rd image should be placed in the article where it makes sense.\n- Return the complete updated article.\n\n**Note - Critical instruction:** Make sure the output HTML does not contain the word ```html\\n; exclude it."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "8ff53c67-8af7-42a3-a97c-65b625a83f8d",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3536,
        208
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "eb43e804-ef6f-4c75-93bd-e511928b1a80",
      "name": "Google Gemini Chat Model For Content Writing1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        336,
        416
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c9af9c79-be7b-428a-943a-7511422fea86",
      "name": "Thumbnail Image Generator1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2400,
        144
      ],
      "parameters": {
        "url": "https://api.ideogram.ai/v1/ideogram-v3/generate",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "=prompt",
              "value": "={{ $('generate_image_prompt').item.json.output['Thumbnail Prompt'] }}"
            },
            {
              "name": "rendering_speed",
              "value": "TURBO"
            },
            {
              "name": "resolution",
              "value": "1280x704"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Api-Key",
              "value": "your_api_key"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "c9168cbf-fc6c-42d5-aee4-2e230ac03941",
      "name": "Blog Image Generator1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2400,
        320
      ],
      "parameters": {
        "url": "https://api.ideogram.ai/v1/ideogram-v3/generate",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "=prompt",
              "value": "={{ $('generate_image_prompt').item.json.output['Image Prompt 1'] }}"
            },
            {
              "name": "rendering_speed",
              "value": "TURBO"
            },
            {
              "name": "resolution",
              "value": "1280x704"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Api-Key",
              "value": "your_api_key"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "c720a6ff-a39b-4b41-a019-0d73ee8b8a1d",
      "name": "Blog Image Binary Conversion1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2608,
        320
      ],
      "parameters": {
        "url": "={{ $json.data[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "db5f49be-e160-4cdc-8cb4-b8fe36cd1b07",
      "name": "Thumbnail Image Binary Conversion1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2608,
        144
      ],
      "parameters": {
        "url": "={{ $json.data[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "6bdda80e-5ad7-4cec-99fc-8e38349f3d92",
      "name": "Thumbnail Uploading1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2816,
        144
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            },
            {
              "name": "Content-Disposition",
              "value": "attachment; filename=image.jpg"
            }
          ]
        },
        "inputDataFieldName": "data"
      },
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "8240846d-473f-4c80-b875-431c665ce3ac",
      "name": "Blog Image Uploading1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2816,
        320
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            },
            {
              "name": "Content-Disposition",
              "value": "attachment; filename=image.jpg"
            }
          ]
        },
        "inputDataFieldName": "data"
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "a7735c8d-bc4a-4f9a-b35d-323885664c56",
      "name": "Add Alt Text in Blog Image1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        3008,
        320
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/media/{{ $json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "alt_text",
              "value": "={{ $('generate_image_prompt').item.json.output['Alt Text Image 1'] }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "44a6f500-c5c4-4af4-b08b-31c507aefbcd",
      "name": "Add Alt Text in Thumbnail Image1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        3008,
        144
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/media/{{ $json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "alt_text",
              "value": "={{ $('generate_image_prompt').item.json.output['Alt Text Thumbnail Image'] }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "4f45d9ea-5bca-44d4-88d8-796e489fe260",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 352,
        "height": 144,
        "content": "### Input & Triggers\n- Starts the workflow\n- Collects initial data\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0208f2bf-a321-4a0b-8316-509cc304c805",
      "name": "If Error Existed Then Get Notified1",
      "type": "n8n-nodes-base.discord",
      "position": [
        3232,
        496
      ],
      "parameters": {
        "content": "=Hi <@your_discord_id> and <@your_discord_id>\nContent Posting Automation\n\n{{ $('PBN_Website_Access').item.json['Complete URL'] }}\n\n\n\nError:\n{{ $json.error.name }}\n\n{{ $json.error.message }}\n\n{{ $json.error.code }} {{ $json.error.status }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "3e51de1b-8d10-4866-82e4-47073443e8c6",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        848,
        592
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ac089e36-398e-4206-9453-6ff535cb9588",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        912,
        496
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\"category\":\"\"}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a6a39619-dfa0-4766-b4b9-70124a83ffaf",
      "name": "If Error Existed Then Get Notified",
      "type": "n8n-nodes-base.discord",
      "position": [
        1808,
        560
      ],
      "parameters": {
        "content": "=Hi <@your_disocrd_id> and <@your_discord_id>\nContent Posting Automation \n\n{{ $('PBN_Website_Access').item.json['Complete URL'] }}\n\nError:\n{{ $json.error.name }}\n\n{{ $json.error.message }}\n\n{{ $json.error.code }} {{ $json.error.status }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8f8717db-3f07-4b77-9755-f1f07bda3058",
      "name": "Schedule_Publish",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1440,
        240
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "413c6cd3-4c58-4633-9dc5-a0b1b5bb466e",
      "name": "Get_Post_Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1184,
        240
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "=your_tab_id"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=your_sheet_id"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "2f03a7f9-7808-4084-b3c1-5f97e4017219",
      "name": "Post_Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -992,
        240
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "5a998947-603d-4b47-8744-6e3eddc854e6",
      "name": "get_client_status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -768,
        256
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $('Get_Post_Data').item.json['Domain ID'] }}",
              "lookupColumn": "Client ID"
            },
            {
              "lookupValue": "Active",
              "lookupColumn": "Project Status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "=yourTabID"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=yourSheetID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "6030fdaf-8b08-446c-b628-919fe4b63cbb",
      "name": "client_active_check",
      "type": "n8n-nodes-base.if",
      "position": [
        -560,
        256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7d4b7b7f-a134-46b7-9cd1-0626eb48250d",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json['Client ID'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "532afaf6-4302-4d5e-9e0e-e4dfc32f1a7a",
      "name": "PBN_Website_Access",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -352,
        240
      ],
      "parameters": {
        "url": "https://script.google.com/macros/s/AKfycbxOs_UH6UGpXgJwKArmbV_kW-vQ2vDS1a7897y8mslM3FE-6k8WDseo-qCmcZD600eCpw/exec",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "api_key",
              "value": "your_api_key"
            },
            {
              "name": "domain",
              "value": "={{ $('Post_Loop').item.json['Posting Website'] }}"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "f4037d90-f156-4e83-abee-3a3c62d02fe2",
      "name": "Do the Research on the Topic",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -160,
        240
      ],
      "parameters": {
        "text": "=Anchor Keyword: {{ $('Post_Loop').item.json.Keyword }}\nAnchor Link: {{ $('Post_Loop').item.json['Landing Page'] }}\nMost Critical Instructions: {{ $('get_client_status').item.json['Most Critical Instructions From Client That Must Be Taken Care Seriously'] }}",
        "options": {
          "systemMessage": "=I will provide you with a targeted **anchor keyword** and an **anchor link**. As an expert content writer, your task is to conduct comprehensive research and deliver a detailed, actionable report specifically tailored to optimizing the content for these. Your goal is to help craft a highly engaging, user-focused blog post that maximizes both **SEO impact** and **user engagement**.\n\nYour report should include the following sections:\n\n---\n\n### 1. Search Intent Analysis\n\n- Identify the **primary search intent** (Informational, Commercial, Navigational, Transactional) behind the **anchor keyword**.\n- Explain why this intent matters when shaping the blog post strategy, and how it relates to the **anchor link**.\n\n---\n\n### 2. Top Competitor Insights\n\n- Analyze the **top 5\u201310 ranking pages** for the anchor keyword.\n- For each, provide:\n  - **Title**\n  - **Meta Description**\n  - **URL**\n  - **Brief Summary** highlighting:\n    - Their approach to content\n    - Strengths in SEO or value delivery\n    - How they use the anchor keyword (or variations)\n\n---\n\n### 3. Content Gaps & Opportunities\n\n- Identify **missing elements** or weak points in top-ranking content.\n- Explain how your blog can **outperform** by:\n  - Filling these gaps\n  - Providing unique insights, visuals, tools, or data\n  - Offering better alignment with the anchor keyword and anchor link\n\n---\n\n### 4. Audience Profile & Needs\n\n- Describe the **target audience** searching for the anchor keyword.\n- Include insights on:\n  - Demographics (age, profession, location if relevant)\n  - Pain points and goals\n  - Questions they want answered\n  - How your content can best **serve their needs**\n\n---\n\n### 5. Trending Subtopics & Related Keywords\n\n- List **relevant, trending subtopics** and **related keywords** to expand the blog content.\n- Where possible, include:\n  - **Search Volume**\n  - **Keyword Difficulty**\n- Show how these relate to the **anchor keyword** and enhance topical coverage.\n\n---\n\n### 6. LSI Keywords & Related Keywords\n\n- Provide:\n  - **5 LSI (Latent Semantic Indexing) keywords**\n  - **5 Closely Related Keywords**\n- These will help improve **content relevance and SEO strength**.\n\n---\n\n### 7. SEO-Optimized Blog Outline\n\n- Propose a **detailed blog outline** with:\n  - SEO-optimized headings and subheadings\n  - Logical content flow\n  - Sections mapped to user intent\n  - Integration points for the anchor keyword and anchor link\n\n---\n\n### 8. Trusted Sources & References\n\n- List **credible sources** and **reference links** for:\n  - Statistics\n  - Industry opinions\n  - Supporting facts\n- Ensure the blog content remains **authoritative and trustworthy**.\n\n**Goal**: Make the blog post stand out by delivering practical, actionable insights that are tightly aligned with the **anchor keyword** and **anchor link**, while providing unmatched value to the reader.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d26cc60e-d24d-4230-9856-7d05c848e2f4",
      "name": "sitemap_crawl( internal_linking )",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        144,
        240
      ],
      "parameters": {
        "url": "={{ $('PBN_Website_Access').item.json['Sitemap Post URL'] }}",
        "options": {}
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "0a42da3a-6b1c-450e-b630-6ba3c5e9273b",
      "name": "write_content",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        336,
        240
      ],
      "parameters": {
        "text": "=- **Anchor Keyword:** {{ $('Get_Post_Data').item.json.Keyword }}\nExternal Anchor Link:{{ $('Get_Post_Data').item.json['Landing Page'] }}\nTarget Keyword: {{ $('Get_Post_Data').item.json.Keyword }}\n - Reaesrch: {{ $('Do the Research on the Topic').item.json.output }}\n\nInternal Link Opportunities:\n{{ $json.data.match(/<loc>(.*?)<\\/loc>/g)\n    .map(x => x.replace(/<\\/?loc>/g, ''))\n    .join(' ')\n    .split(' ')\n    .slice(0, 200)\n    .join(' ') \n}}\n",
        "options": {
          "systemMessage": "=You are an expert content writer. Write an 800\u20131000 word article in clear, easy-to-read, conversational English. Use short sentences, avoid heavy jargon, and explain technical terms simply for all worldwide audiences. The content must have a high readability score.\n\nInstructions:\n- Start content with the Question.\n- Do not use AI Terms like Imagine or any other type of AI words that can show the article is written by AI\n- Use simple HTML with only these tags: <h1>, <h2>, <p>, <ul>, <ol>, <b>, <i>, <a>.\n- Start directly with the content section\u2014no <head>, <footer>, CSS, or extra formatting.\n\nAnchor Keyword Rule:\n- The anchor keyword {{ $('Post_Loop').item.json.Keyword }} should appear naturally 2\u20133 times in the entire article (including title and subheadings).\n- **CRITICAL: Use the anchor keyword as a hyperlink ONLY ONCE in the entire article.** This hyperlink must appear in the first, second, or third paragraph.\n- Format: <a href=\"[target URL]\" style=\"color: #256181; font-weight: 700\">{{ $('Post_Loop').item.json.Keyword }}</a>\n- Do NOT hyperlink the anchor keyword anywhere else in the article.\n- Use\n\nInternal Links Rule:\n- Add 1-2 additional internal links to relevant pages on the target website.\n- These internal links must use DIFFERENT anchor text (not the main anchor keyword).\n- Use descriptive, natural anchor text for internal links.\n- Format: <a style=\"color: #256181; font-weight: 700\" href=\"[URL]\">[descriptive anchor text]</a>\n- Use relevant anchor link from here\nInternal Link Opportunities:\n{{ $json.data.match(/<loc>(.*?)<\\/loc>/g)\n    .map(x => x.replace(/<\\/?loc>/g, ''))\n    .join(' ')\n    .split(' ')\n    .slice(0, 200)\n    .join(' ') \n}}\n\n\nContent Guidelines:\n- Avoid using any 3rd party brand name, symbol, or slogan (100% strict).\n- The article should always create positive vibes; avoid negative tone or discouraging words.\n- Integrate the primary keyword naturally without repeating it too closely.\n- Add relevant LSI keywords naturally to provide context.\n- Keep paragraphs short (3\u20134 sentences) to enhance readability.\n- Avoid repeated points and do not use em dashes or \\n line breaks in the HTML.\n- Write as if explaining to a smart friend, with practical tips and examples tailored for Indian investors.\n- Avoid keyword stuffing; integrate keywords naturally throughout the text.\n- Make sure to add a minimum of 2 relevant FAQs at the end of the article to provide additional value to readers\n\nDeliverable:\nOutput only the HTML content \u2014 no explanations or extra comments.\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "2db107e3-6697-47cc-852c-6e8a0a8657d7",
      "name": "extract_title_body",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        240
      ],
      "parameters": {
        "jsCode": "// Get the input string\nlet content = $input.first().json.output;\n\n// Remove all newlines\ncontent = content.replace(/\\n/g, '');\n\n// Remove em dashes\ncontent = content.replace(/\u2014/g, ' ');\n\n// Extract the content inside the first <h1> tag\nconst h1Match = content.match(/<h1[^>]*>(.*?)<\\/h1>/);\nconst h1Content = h1Match ? h1Match[1] : '';\n\n// Remove all <h1> tags and their content from the original string\nconst excludedH1Content = content.replace(/<h1[^>]*>.*?<\\/h1>/g, '');\n\nreturn {\n  json: {\n    h1Only: h1Content,\n    excludedH1: excludedH1Content\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "bb883967-8940-4b3b-9e4b-c1b5712f519f",
      "name": "classify_category",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueRegularOutput",
      "position": [
        848,
        240
      ],
      "parameters": {
        "text": "=You are a category classifier.\nRead the given blog title carefully and determine the **most suitable category** for publishing.\nChoose **only one** category strictly from this list:\n`business, tech, travel, health, finance, lifestyle, education, food, sports, entertainment`.\n\n* If the blog title clearly fits one of these categories, return that category.\n* If the blog title doesn\u2019t exactly match any category, **suggest the closest possible category** based on context.\n* Return the category name in **lowercase only**.\n\n**Example outputs:**\n\n* Blog title: \u201cTop 10 Healthy Recipes for Weight Loss\u201d \u2192 `food`\n* Blog title: \u201cHow to Invest in Cryptocurrency Safely\u201d \u2192 `finance`\n* Blog title: \u201cBest Remote Work Tools for 2025\u201d \u2192 `tech`\n\nRules:\n\n* Output must be in **JSON format**.\n* Return only the **category name in lowercase**.\n* No extra text, explanation, or punctuation.\n\nReturn output in this format:\n\n```json\n{\"category\":\"<category_name>\"}\n```\n\nBlog title: `{{ $json.h1Only }}`\n\n\u2705 *Example 1:*\nBlog title: \u201cTop 10 Destinations to Visit in Europe\u201d\nOutput:\n\n```json\n{\"category\":\"travel\"}\n```\n\n\u2705 *Example 2:*\nBlog title: \u201cHow to Improve Your Mindset for Success\u201d *(not clearly in the list)*\nOutput:\n\n```json\n{\"category\":\"general\"}\n```\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2,
      "alwaysOutputData": true
    },
    {
      "id": "de6ffeca-c824-4108-b974-1327bb4607bb",
      "name": "get_category",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        1152,
        240
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/categories?search={{ $json.output.category}}\n",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "566a4744-d2bb-4d93-ba95-c12b23cc42cd",
      "name": "category_exists_check",
      "type": "n8n-nodes-base.if",
      "position": [
        1296,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6d2cc2bf-1459-43bd-bb12-a471e12f7a5c",
              "operator": {
                "type": "number",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "46c5936b-ef6e-4169-be7d-ec03d1063a80",
      "name": "create_category",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        1472,
        240
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/categories",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $('classify_category').item.json.output.category }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1177bab6-ab6a-4929-a0f9-c4dcaeaa22b4",
      "name": "set_category_id",
      "type": "n8n-nodes-base.set",
      "position": [
        1632,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1df28cf6-d0fa-408e-b508-b5e3fc88bdcc",
              "name": "id",
              "type": "string",
              "value": "={{$json.id}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "740ae741-fd35-4e9f-b3dc-21a6a550b59a",
      "name": "error_guard",
      "type": "n8n-nodes-base.if",
      "position": [
        1824,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d5e51d29-033e-4293-a44d-f5dd716d28d3",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "bdb73cae-e1da-47bf-9b07-106b008782a5",
      "name": "generate_image_prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2048,
        224
      ],
      "parameters": {
        "text": "=**INPUT:**\nHeading: {{ $('extract_title_body').item.json.h1Only }}\nContent:{{ $('extract_title_body').item.json.excludedH1 }}",
        "options": {
          "systemMessage": "=You are an AI specialist in creating image generation prompts for blog articles. Analyze the given blog content and generate prompts for 3 high-quality, relevant images.\n\nYOUR TASK:\nGenerate exactly 3 images:\n1. Thumbnail/Featured Image - Main hero image for the article\n2. Content Image 1 - Supporting visual for article body\n3. Content Image 2 - Supporting visual for article body\n\nTHUMBNAIL/FEATURED IMAGE:\n- Photorealistic, high-impact professional photograph\n- Eye-catching and engaging composition\n- Clean, professional aesthetic with neutral/white background\n- Wide aspect ratio (16:9)\n- STRICTLY NO TEXT, NO OVERLAYS, NO CAPTIONS, NO LABELS\n- Central focal point with professional lighting\n- Modern, contemporary style\n\nCONTENT IMAGES (1 & 2):\n- Photorealistic professional photographs\n- Each relates to different subtopics from article\n- Clean, minimalist composition with neutral/white background\n- ABSOLUTELY NO TEXT, NO LABELS, NO ANNOTATIONS\n- Natural, professional lighting\n\nSTRICTLY AVOID (ALL IMAGES):\n- Any text, words, letters, numbers, typography\n- Labels, captions, titles, annotations\n- Logos, brand names, watermarks\n- Infographics, charts, graphs with text\n- Screenshots or UI elements\n- Artificial, cartoon, or illustrated styles\n- Cluttered compositions or dark/blurry images\n\nPROMPT TEMPLATE:\nThumbnail: \"Professional high-quality hero photograph of [main subject], [visual details], clean white/neutral background, photorealistic, cinematic lighting, sharp focus, eye-catching, NO TEXT, NO LABELS, 8K quality, commercial photography, wide angle\"\n\nContent: \"Professional photograph of [subtopic element], [details], clean white/neutral background, photorealistic, natural lighting, sharp focus, minimalist, NO TEXT, NO LABELS, 8K quality, commercial photography\"\n\nOUTPUT FORMAT (JSON):\n{\n  \"Thumbnail_Prompt\": \"[detailed prompt]\",\n  \"Alt_Text_Thumbnail\": \"[SEO alt text]\",\n  \"Image_Prompt_1\": \"[detailed prompt]\",\n  \"Alt_Text_1\": \"[SEO alt text]\",\n  \"Image_Prompt_2\": \"[detailed prompt]\",\n  \"Alt_Text_2\": \"[SEO alt text]\"\n}\n\nANALYSIS STEPS:\n1. Read article and understand main topic\n2. Identify powerful thumbnail concept\n3. Find 2 key subtopics for content images\n4. Create specific photorealistic prompts\n5. Ensure NO TEXT in all prompts\n6. Verify relevance to article\n\nCRITICAL: ZERO TEXT in any image. Always emphasize \"NO TEXT, NO LABELS\" in every prompt.\n\nNow analyze the provided blog article and generate 3 image prompts with alt text in JSON format."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "6cb1edac-9dbd-4b0f-8749-f7ef8dfab0e2",
      "name": "merge_data",
      "type": "n8n-nodes-base.merge",
      "position": [
        3216,
        224
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b94ebf07-60f1-4526-b584-4b4cdde18c64",
      "name": "final_validation_check",
      "type": "n8n-nodes-base.if",
      "position": [
        3360,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8e3e2f4a-20b3-44eb-b972-990b4c8a8f9a",
              "operator": {
                "type": "number",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.error.status }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8b84b1d9-fe04-4ab9-a915-a024e75b5eb6",
      "name": "publish_blog",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        3968,
        208
      ],
      "parameters": {
        "url": "={{ $node['PBN_Website_Access'].json['Complete URL'] }}wp-json/wp/v2/posts ",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "title",
              "value": "={{ $('extract_title_body').item.json.h1Only }}"
            },
            {
              "name": "content",
              "value": "={{ $json.output.replace(/^```html\\n/, '').replace(/\\n```$/, '') }}"
            },
            {
              "name": "status",
              "value": "publish"
            },
            {
              "name": "featured_media",
              "value": "={{ $('Aggregate1').item.json.data[0].id }}"
            },
            {
              "name": "categories[]",
              "value": "={{ $('set_category_id').item.json.id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Basic {{ $node['PBN_Website_Access'].json.Basic_Token }}"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "3a99e9ce-7848-4978-9128-35e40d9b65fd",
      "name": "save_live_url",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueRegularOutput",
      "position": [
        4128,
        208
      ],
      "parameters": {
        "columns": {
          "value": {
            "Domain ID": "={{ $('Post_Loop').item.json['Domain ID'] }}",
            "Link Type": "link_type_ex_guest_post",
            "Live URLs": "={{ $json.guid.rendered }}",
            "Timestamp": "={{ $now.format('yyyy-MM-dd hh-mm') }}",
            "Anchor Link": "={{ $('Get_Post_Data').item.json['Landing Page'] }}",
            "Website URL": "={{ $('Get_Post_Data').item.json['Posting Website'] }}",
            "Anchor Keyword ": "={{ $('Get_Post_Data').item.json.Keyword }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Domain ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Domain ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Link Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Link Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Anchor Keyword ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Anchor Keyword ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Anchor Link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Anchor Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Website URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Live URLs",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Live URLs",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Backlink Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Backlink Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Remarks",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Remarks",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Quality Check Rating",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Quality Check Rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rating Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Rating Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Backlinks Sheet Updated",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Backlinks Sheet Updated",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "=your_sheet_id"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "=yourSheetURL"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "55702c08-6d87-4625-9663-8f3084a1f676",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -128
      ],
      "parameters": {
        "width": 528,
        "height": 944,
        "content": "# Automated Blog Publishing Workflow\n\nThis workflow automates the complete blog publishing process from topic research to WordPress publication. It uses AI models to create SEO-optimized content, generates images with Ideogram, and manages categories automatically.\n\n## How it works\n\nThe workflow starts with a scheduled trigger or manual run. It fetches blog topics from Google Sheets, validates active projects, and performs SEO research on the keyword. An AI agent writes 800-1000 word content with proper HTML formatting and internal links. The workflow then generates featured and in-content images using Ideogram API, uploads them to WordPress with SEO-friendly alt text, detects or creates blog categories, and publishes the complete post. Finally, it logs the live URL back to Google Sheets and sends error notifications if any step fails.\n\n## Setup steps\n\n1. **Add credentials**: Configure Google Sheets OAuth, WordPress API, AI model (Gemini/OpenAI/DeepSeek), Ideogram API, and Discord/Slack webhook in n8n's credential manager.\n\n2. **Configure Google Sheet**: Create a sheet with columns for blog topic, target website, publishing status, and domain ID. Update the sheet ID in the Get_Post_Data node.\n\n3. **Set WordPress access**: Update the PBN_Website_Access node with your WordPress site endpoint that returns site URL, auth token, and sitemap URL.\n\n4. **Adjust schedule**: Configure the Schedule Trigger for your preferred publishing time and frequency.\n\n5. **Test workflow**: Add one test row in Google Sheets, run manually, and verify content creation, image generation, publishing, and sheet updates before activating."
      },
      "typeVersion": 1
    },
    {
      "id": "dd645f6e-4572-4117-8098-f417266c4de2",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "content": "Content Research\n- Fetches URLs and keywords\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f1078687-9ca4-4a41-9cd0-eb8bbdf6766e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "content": "AI Content Generation\n- Generates blog content\n"
      },
      "typeVersion": 1
    },
    {
      "id": "70cd7bff-834a-4aa9-af63-299f77eb9398",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "content": "Image Generation\n- Creates blog images\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Post_Loop": {
      "main": [
        [],
        [
          {
            "node": "get_client_status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Blog and Photo Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "merge_data": {
      "main": [
        [
          {
            "node": "final_validation_check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "error_guard": {
      "main": [
        [
          {
            "node": "generate_image_prompt",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Error Existed Then Get Notified",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post_Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get_category": {
      "main": [
        [
          {
            "node": "category_exists_check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "publish_blog": {
      "main": [
        [
          {
            "node": "save_live_url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get_Post_Data": {
      "main": [
        [
          {
            "node": "Post_Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "save_live_url": {
      "main": [
        [
          {
            "node": "Post_Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "write_content": {
      "main": [
        [
          {
            "node": "extract_title_body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create_category": {
      "main": [
        [
          {
            "node": "set_category_id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set_category_id": {
      "main": [
        [
          {
            "node": "error_guard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule_Publish": {
      "main": [
        [
          {
            "node": "Get_Post_Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "classify_category": {
      "main": [
        [
          {
            "node": "get_category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get_client_status": {
      "main": [
        [
          {
            "node": "client_active_check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "classify_category",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "PBN_Website_Access": {
      "main": [
        [
          {
            "node": "Do the Research on the Topic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract_title_body": {
      "main": [
        [
          {
            "node": "classify_category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "client_active_check": {
      "main": [
        [
          {
            "node": "PBN_Website_Access",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post_Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Thumbnail Uploading1": {
      "main": [
        [
          {
            "node": "Add Alt Text in Thumbnail Image1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog Image Generator1": {
      "main": [
        [
          {
            "node": "Blog Image Binary Conversion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog Image Uploading1": {
      "main": [
        [
          {
            "node": "Add Alt Text in Blog Image1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog and Photo Merge1": {
      "main": [
        [
          {
            "node": "publish_blog",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "category_exists_check": {
      "main": [
        [
          {
            "node": "set_category_id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "create_category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "generate_image_prompt": {
      "main": [
        [
          {
            "node": "Thumbnail Image Generator1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Blog Image Generator1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "final_validation_check": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Error Existed Then Get Notified1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt Generator1": {
      "ai_languageModel": [
        [
          {
            "node": "generate_image_prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "classify_category",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Do the Research on the Topic",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Blog and Photo Merge1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "generate_image_prompt",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Thumbnail Image Generator1": {
      "main": [
        [
          {
            "node": "Thumbnail Image Binary Conversion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Alt Text in Blog Image1": {
      "main": [
        [
          {
            "node": "merge_data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Do the Research on the Topic": {
      "main": [
        [
          {
            "node": "sitemap_crawl( internal_linking )",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog Image Binary Conversion1": {
      "main": [
        [
          {
            "node": "Blog Image Uploading1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Alt Text in Thumbnail Image1": {
      "main": [
        [
          {
            "node": "merge_data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sitemap_crawl( internal_linking )": {
      "main": [
        [
          {
            "node": "write_content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Error Existed Then Get Notified": {
      "main": [
        [
          {
            "node": "Post_Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Thumbnail Image Binary Conversion1": {
      "main": [
        [
          {
            "node": "Thumbnail Uploading1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Error Existed Then Get Notified1": {
      "main": [
        [
          {
            "node": "Post_Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model For Content Writing1": {
      "ai_languageModel": [
        [
          {
            "node": "write_content",
            "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

This workflow automates the complete blog publishing process. It removes manual work from content creation, image generation, category management, and WordPress publishing by using AI and n8n. It helps agencies, SEO teams, and content creators manage blogs at scale. Scheduled or…

Source: https://n8n.io/workflows/12939/ — 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 n8n workflow is designed for content creators, digital marketers, and social media managers who want to automate their entire content creation and publishing process across multiple platforms. It

Google Sheets, WordPress, Edit Image +13
AI & RAG

This n8n workflow automates the complete blog publishing process from topic research to WordPress publication. It researches topics, writes SEO-optimized content, generates images, publishes posts, an

Google Gemini Chat, Agent, Google Sheets +3
AI & RAG

This workflow is designed for Google Ads advertisers, PPC managers, and marketing teams who want to automatically monitor and optimize their search term performance. It's particularly valuable for tho

Slack, HTTP Request, Agent +11
AI & RAG

Who is this template for? This workflow is perfect for competitive‑intel analysts, product managers, content marketers, and anyone who tracks multiple company blogs or news sources. If you need a week

HTTP Request, Output Parser Structured, Agent +5
AI & RAG

⏺ 🚀 How it works

Agent, Anthropic Chat, Output Parser Structured +6