Piotr Sikora - Logo - Automatyzacja procesów | AI | JavaScript | Front End | Team Leader
  • Home
  • Services
    • Process Automation
    • AI for Lawyers
  • Blog
  • Quotes
  • Contact
PL/EN

n8n Workflow: Auto-Assign Categories & Tags with AI

  • Home
  • Blog
  • n8n Workflow: Auto-Assign Categories & Tags with AI
n8n Workflow: Auto-Assign Categories & Tags with AI

By Piotr Sikora

  • n8n

  • 20 October 2025

  • 5 min read

Table of Contents

  • The Problem
  • The Solution: n8n + OpenAI + GitHub + Google Sheets
  • Who It’s For
  • How It Works
  • Requirements
  • How to Set Up
  • How to Customize
  • Important Notes
  • Where Could You Find the Workflow
  • Do You Need Customization or Another Workflow?

Automatically Assign Categories and Tags to Blog Posts with AI

A few months ago, a content manager reached out with a familiar problem:

“We publish new blog posts every week, but organizing them is a nightmare. Each author uses different tags, and we’re never consistent. Could we use AI to handle this automatically?”

The request was clear - they wanted something that would analyze each new blog post, suggest categories and tags, and keep everything organized without manual editing.

That’s how the Automatically Assign Categories and Tags to Blog Posts with AI workflow came to life.


The Problem

Managing a content-heavy site means balancing creativity with structure.
Writers focus on storytelling, but editors and SEO specialists spend valuable time fixing metadata, ensuring consistent tags, and maintaining content hierarchy.

When posts are stored in GitHub (as Markdown or MDX files), manually reviewing each one is slow and repetitive. The content manager’s team needed a way to automate tagging and centralize metadata tracking - all while keeping control over final approvals.


The Solution: n8n + OpenAI + GitHub + Google Sheets

This workflow uses n8n to create an automated pipeline that:

  1. Scans a GitHub repository for new Markdown blog posts.
  2. Analyzes each article’s frontmatter and content using OpenAI GPT-4.1-mini.
  3. Suggests tags and categories using a structured AI prompt.
  4. Logs all results in Google Sheets for review and future reference.

The result is a continuous, AI-driven curation system that keeps your content taxonomy consistent and easy to manage.


Who It’s For

  • Content creators and editors managing static websites (Astro, Next.js, etc.).
  • SEO specialists looking for consistent metadata and topic grouping.
  • Developers or teams maintaining Markdown-based blogs in GitHub who want to speed up categorization.

How It Works

Here’s the full process inside the workflow:

  1. Form Trigger - Starts the process manually, allowing a user to initiate content analysis on demand.

  2. Get Data from Google Sheets - Fetches existing post records to avoid reprocessing articles that were already analyzed.

  3. Compare GitHub and Google Sheets - Lists all .md or .mdx blog posts in the repository (e.g., piotr-sikora.com/src/content/blog/pl/) and filters out those already logged.

  4. Check New Repo Files (Code) - Uses a code node to identify only new blog files needing analysis.

  5. Switch Node -

    • If no new posts are found → workflow stops and confirms completion.
    • If new posts exist → moves to AI analysis.
  6. Get Post Content from GitHub - Downloads each article’s Markdown content and reads its metadata.

  7. AI Agent (LangChain + OpenAI GPT-4.1-mini) -

    • Examines both frontmatter (--- block) and post body.
    • Suggests categories and tags relevant to the topic.
    • Returns structured JSON output for consistent results.
  8. Append to Google Sheets - Logs details including:

    • File name
    • Existing tags and categories
    • Proposed AI-generated tags and categories
  9. Completion Message - Displays a summary once all new posts are processed.


Requirements

  • GitHub account with repository access.
  • Google Sheets connection for storing metadata suggestions.
  • OpenAI account with API key saved in openAiApi credentials.
  • n8n instance (Cloud or self-hosted).

How to Set Up

  1. Connect your GitHub, Google Sheets, and OpenAI credentials in n8n.
  2. Update the GitHub node with your repository path (e.g., src/content/blog/en/).
  3. In Google Sheets, prepare columns:
    • FileName, Categories, Proposed Categories, Tags, Proposed Tags.
  4. Adjust the AI prompt in the LangChain node if you prefer a different tone or tagging logic.
  5. Run the workflow manually using the Form Trigger node whenever you add new content.

How to Customize

  • Change the AI model: Replace GPT-4.1-mini with another LLM (e.g., Claude, Gemini) in the LangChain node.
  • Edit the AI prompt: Adjust categorization style, tone, or format.
  • Auto-update files: Add a GitHub commit node to write AI-generated metadata back to the Markdown files.
  • Automate scheduling: Add a Schedule Trigger to run daily or weekly.
  • Integrate notifications: Add Slack or email alerts when new tagging suggestions are available.

Important Notes

  • All API keys are stored securely using n8n Credentials — no hardcoding.
  • The workflow includes sticky notes explaining key sections:
    • Repository setup
    • File retrieval and AI tagging logic
    • Google Sheets data handling
  • Uses a LangChain memory buffer to maintain contextual consistency between multiple posts during analysis.

Where Could You Find the Workflow

You can find this workflow in the n8n Community Workflows section.

Workflow on n8n Community

If you’re using a self-hosted instance, you can import the .json file directly from the shared repository or from my GitHub profile (link coming soon).
Once imported, connect your credentials and point it to your GitHub content folder — you’re ready to automate tagging instantly.


Do You Need Customization or Another Workflow?

If you’d like to:

  • Adjust the AI prompt for specific content niches or languages
  • Integrate it with Notion, Airtable, or a headless CMS
  • Add real-time updates or Slack notifications
  • Or build a completely new automation around your publishing process

I can help you customize or create workflows tailored to your exact needs.
Reach out if you’d like to streamline your editorial pipeline or explore new ways to use AI within your content management setup.

Tags:

    #n8n

    #workflow

    #SEO

    #Content manager

Comments

Categories

after-hours(1)AI(7)ai-en(1)angular(4)automatic-tests(1)Automation(2)cryptography(1)css(8)CyberSecurity(2)Development(7)DevOps(1)events(3)javascript(11)n8n(11)ollama(1)security(2)seo(1)

Recent Posts

n8n: AI Agent and Guardrails – Security Basics When Working with AI

n8n

n8n: AI Agent and Guardrails – Security Basics When Working with AI

Next.js, Ahrefs, and KIMI: How I Hit a Perfect 100 Health Score

Development

Next.js, Ahrefs, and KIMI: How I Hit a Perfect 100 Health Score

Testing Kimi Code: First Impressions from Web and CLI

Development

Testing Kimi Code: First Impressions from Web and CLI

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

Automation

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

DRY, WET, AHA: Finding the Right Balance in Code Reuse

Development

DRY, WET, AHA: Finding the Right Balance in Code Reuse

About Me

Piotr Sikora - Process Automation | AI | n8n | Python | JavaScript

Piotr Sikora

Process Automation Specialist

I implement automation that saves time and money, streamlines operations, and increases the predictability of results. Specializing in process automation, AI implementation, and workflow optimization using n8n, Python, and JavaScript.

n8n Workflows

n8n workflow automation templates

Explore my workflow templates on n8n. Ready-to-use automations for blog management, data collection, and AI-powered content processing.

3Workflow Templates
View Templates

• Auto-Categorize Blog Posts with AI

• Collect LinkedIn Profiles

• Export WordPress Posts for SEO

Tags

activepiecesafter-hoursahrefsaiAI cost reductionai-agentsai-automationangularantigravityapiAqua Securityarcade-gamesarchitectureautomationbackendbest-practicescadillacs-and-dinosaurschatbotchatgptCI/CD
“Everything we hear is an opinion, not a fact”
Marcus Aurelius
View more quotes

Similar Articles

Discover more related content

n8n Workflow: Export WordPress Posts for SEO

n8n Workflow: Export WordPress Posts for SEO

n8n workflow for content manager and SEO specialists

26 October 2025
n8n Workflow: Automating LinkedIn Profile Search for HR

n8n Workflow: Automating LinkedIn Profile Search for HR

n8n workflow for HR recruiters. It's a simple way to automate LinkedIn profile collection.

20 October 2025
n8n: AI Agent and Guardrails – Security Basics When Working with AI

n8n: AI Agent and Guardrails – Security Basics When Working with AI

In this video I show how to take care of data security using the Guardrails node in n8n

6 March 2026
Piotr Sikora | ai | n8n | javascript | python

Let's get to know each other!

Get in touch with me
Piotr Sikora | Process Automation  | AI Implementation 🤖 | Technology Consulting
Quick links
  • Home
  • Blog
  • Contact
Contact
  • piotr.sikora.ck@gmail.com
  • +48 505 684 661

© Piotr Sikora 2026 | All Rights Reserved