AutomationFlowsGeneral › AI Comment Generator for WordPress

AI Comment Generator for WordPress

Original n8n title: Awesome N8n Templates (http Request)

Awesome N8N Templates. Uses manualTrigger, stickyNote, httpRequest, openAi. Event-driven trigger; 7 nodes.

Event trigger★★★★☆ complexityAI-powered7 nodesHTTP RequestOpenAI
General Trigger: Event Nodes: 7 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the HTTP Request → OpenAI 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": "37f90234-8233-495a-b9e5-394de7c76852",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -16,
        -272
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4d31b3f6-bc9c-467d-a797-682570710b9b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -400
      ],
      "parameters": {
        "color": 4,
        "width": 1648,
        "height": 320,
        "content": "## Article AI Comment Generator\n\nThis workflow uses AI to generate relevant, natural-sounding comments for blog posts. It retrieves articles via the WordPress REST API, builds a prompt from the post content, and posts the AI-generated comment back to the site.\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fa18a2e9-b5ab-4d96-bd04-bd5914c69a8b",
      "name": "Fetch Articles from WordPress",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 5,
      "position": [
        208,
        -272
      ],
      "parameters": {
        "url": "https://example.com/wp-json/wp/v2/posts?per_page=100&status=publish&_fields=id,title,excerpt,content,link,comment_status",
        "options": {
          "timeout": 60000,
          "batching": {
            "batch": {
              "batchSize": 25
            }
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 2000
    },
    {
      "id": "93d2699f-0579-463c-a7d8-d35c89c058cf",
      "name": "Build Article Comment Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        -272
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3af62c72-bd9b-433a-943c-4caafe23bdd5",
              "name": "prompt",
              "type": "string",
              "value": "=={{ `For the article \u201c${$json.title?.rendered || ''}\u201d, write a short, natural comment (1 sentence) that is relevant. \nSummary: ${(($json.excerpt?.rendered || $json.content?.rendered || '')\n  .replace(/<[^>]+>/g,' ')\n  .replace(/\\s+/g,' ')\n  .trim()).slice(0,300)}` }}\nComment characteristics:\n- If possible, use the article's keyword in the comment\n- Some positive, some neutral\n- Conversational tone, not formal\n- Some short, some long\n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "532d9763-aa7b-4903-9af4-be58fa4d2fd0",
      "name": "Generate Article Comment (AI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        736,
        -272
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "GPT-5"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=={{$json.prompt}}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1.8,
      "waitBetweenTries": 2000
    },
    {
      "id": "4128f339-860f-4920-ae79-beb6c9bf43d4",
      "name": "Extract AI Output1",
      "type": "n8n-nodes-base.set",
      "position": [
        1088,
        -272
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "18fe84dc-59b3-440b-830d-da161cd5e3da",
              "name": "comment",
              "type": "string",
              "value": "={{$json.message?.content || $json.choices?.[0]?.message?.content || $json.content}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "12085249-1c90-41d9-af5c-0ff91f3aedbc",
      "name": "Post Comment to Article",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 5,
      "position": [
        1344,
        -272
      ],
      "parameters": {
        "url": "https://example.com/wp-json/wp/v2/comments",
        "method": "POST",
        "options": {
          "timeout": 60000
        },
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "post",
              "value": "={{ $('Fetch Articles from WordPress').item.json.id }}"
            },
            {
              "name": "content",
              "value": "={{ $('Generate Article Comment (AI)').item.json.message.content }}"
            },
            {
              "name": "author_name",
              "value": "={{ (() => {\n  const first = ['John','Emily','Michael','Sophia','David','Olivia','Daniel','Ava','James','Isabella','Ethan','Mia','William','Charlotte','Benjamin','Amelia','Alexander','Harper','Lucas','Ella'];\n  const last  = ['Smith','Johnson','Williams','Brown','Jones','Garcia','Miller','Davis','Rodriguez','Martinez','Hernandez','Lopez','Gonzalez','Wilson','Anderson','Thomas','Taylor','Moore','Jackson','Martin'];\n  return `${first[Math.floor(Math.random()*first.length)]} ${last[Math.floor(Math.random()*last.length)]}`;\n})() }}\n"
            },
            {
              "name": "author_email",
              "value": "={{ `guest+post${$items(\"Fetch Articles from WordPress\")[$itemIndex()].json.id}-${Date.now()%100000}@example.com`.toLowerCase() }}"
            }
          ]
        },
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 2000
    }
  ],
  "connections": {
    "Extract AI Output1": {
      "main": [
        [
          {
            "node": "Post Comment to Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Article Comment Prompt": {
      "main": [
        [
          {
            "node": "Generate Article Comment (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Articles from WordPress": {
      "main": [
        [
          {
            "node": "Build Article Comment Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Article Comment (AI)": {
      "main": [
        [
          {
            "node": "Extract AI Output1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Fetch Articles from WordPress",
            "type": "main",
            "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

Awesome N8N Templates. Uses manualTrigger, stickyNote, httpRequest, openAi. Event-driven trigger; 7 nodes.

Source: https://github.com/ScraperNode/awesome-n8n-templates/blob/main/templates/ai-and-llm/7580-automate-blog-engagement-with-gpt-5-generated-comments-for-wordpress/workflow.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

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

General

Create and publish Instagram carousels using OpenAI gpt-image-1 and AI caption. Uses chainLlm, outputParserItemList, lmChatOpenAi, splitInBatches. Scheduled trigger; 32 nodes.

Chain Llm, Output Parser Item List, OpenAI Chat +3
General

Generate and schedule social media content across platforms using AI and Google Sheets. Uses stickyNote, googleSheets, openAi, httpRequest. Scheduled trigger; 16 nodes.

Google Sheets, OpenAI, HTTP Request
General

Passive Income with Stock Images. Uses googleDrive, openAi, googleSheets. Event-driven trigger; 15 nodes.

Google Drive, OpenAI, Google Sheets
General

AI Story Generator. Uses chatTrigger, httpRequest, openAi, googleSheets. Chat trigger; 14 nodes.

Chat Trigger, HTTP Request, OpenAI +2
General

17 - AI LinkedIn Responder. Uses httpRequest, openAi, stickyNote, scheduleTrigger. Scheduled trigger; 13 nodes.

HTTP Request, OpenAI, Google Sheets