General
Complete Guide: Building an Automated Blog Publishing System with n8n
Time Pass Dev.to (EN Zone)
16 views
Complete Guide: Building an Automated Blog Publishing System with n8n
If you're a developer who blogs, you know the struggle: you write the content, but formatting, tagging, and uploading it to multiple platforms is a tedious chore.
In this guide, we will set up a robust, end-to-end automation in n8n that converts a raw idea into a professional, formatted Markdown article ready for publication on platforms like Dev.to, Hashnode, or your personal Ghost site.
The Automation Workflow
Trigger: Receive a request from a Google Sheet, Notion page, or Webhook.
AI Drafting: Use OpenAI (GPT-4) to structure and write the content.
Formatting: Use a Code node to apply custom frontmatter and cleaning.
Publishing: Automatically push to your destination platform (Dev.to/GitHub).
Step-by-Step Setup
Step 1: The Trigger
Create a new workflow and add the Webhook node. This will be your input gateway.
Set it to POST.
This allows you to trigger your workflow from a Notion "Publish" button or a simple terminal curl command.
Step 2: Content Generation (OpenAI)
Drag an OpenAI node onto the canvas. Use the Chat resource.
System Prompt: "You are a technical editor. Write detailed articles in Markdown. Use H2 headers, include code blocks for technical examples, and summarize key concepts at the end."
User Prompt: Pass the data from your webhook as the input topic.
Step 3: Standardizing with a Code Node
Standardization is key. Add a Code node to wrap your generated content with metadata (Frontmatter) required by your site.
// Ensure every post has standard frontmatter
const frontmatter = `---
title: ${items[0].json.title}
date: ${new Date().toISOString()}
tags: ["development", "automation"]
---
`;
return {
title: items[0].json.title,
body: frontmatter + items[0].json.generated_content
};
Step 4: The Publishing Engine (Dev.to API)
Use the HTTP Request node to push the draft to Dev.to.
URL: https://dev.to/api/articles
Method: POST
Headers: api-key: YOUR_DEVTO_KEY
Send Body: true
Body Content:
{
"article": {
"title": "{{ $json.title }}",
"body_markdown": "{{ $json.body }}",
"published": false
}
}
Why This Approach Wins
Platform Agnostic: You can duplicate the last step in your n8n workflow to push to both Dev.to and your personal site simultaneously.
Error Handling: Use n8n's "Error Trigger" to get a Slack or Discord alert if the AI fails or the API goes down.
Modularity: Want to change your publishing platform? You only need to swap the final HTTP Request node—the rest of your AI pipeline stays exactly the same.
Finalizing Your Setup
Test: Use the 'Execute Workflow' button in the n8n editor with sample JSON.
Activate: Toggle the Active switch in the top right to turn the webhook live.
Refine: As you use it, tweak your System Prompt in the OpenAI node. Adding specific examples of your own writing style to the prompt will make the AI output feel more human over time.
By treating your blog content as data flowing through an infrastructure pipeline, you move from manual effort to a scalable, professional content strategy.
Read original: https://dev.to/time_pass_d6c977f64396f04/complete-guide-building-an-automated-blog-publishing-system-with-n8n-34j7
← Previous
Stop pasting your JWTs into random websites to decode them
Next →
Sept 3, 2026: Official start with The Odin Project. After being lost in 'resource hell,' I’ve found my path. As an ECE grad, I commit to the consistency and grit needed to become a pro developer. This is where my career begins. Let the grind begin!
Related
Semantic tag vs Non-Semantic tag
General
51
Dev.to (EN Zone)
How LinkedIn "Bold" Text Actually Works (It's Not Bold At All)
General
43
Dev.to (EN Zone)
Google ADK Callbacks Are a Policy Plane, Not Just Hooks
General
44
DEV Community 周榜
How I Modelled My Power BI Data — Data Modelling, Relationships & Joins (Kenya Crops Dataset)
General
41
DEV Community 周榜
Comments0
No comments yet — be the first