Auto-categorize blog posts with OpenAI GPT-4, GitHub, and Google Sheets for Astro/Next.js
Automatically Assign Categories and Tags to Blog Posts with AI This workflow streamlines your content organization process by automatically analyzing new blog posts in your GitHub repository and assigning appropriate categories and tags using OpenAI. It compares new posts against existing entries in a Google Sheet, updates the metadata for each new article, and records the suggested tags and categories for review — all in one automated pipeline. --
At a glance
Auto-categorize blog posts with OpenAI GPT-4, GitHub, and Google Sheets for Astro/Next.js is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets, OpenAI, GitHub, Gemini. It's free to download. Follow the 5-step import below to go live in minutes.
- Platform
- n8n
- Connects
- Google Sheets, OpenAI, GitHub, Gemini
- Modules
- 18
- Price
- Free
- Version
- v1.0

About this workflow
Automatically Assign Categories and Tags to Blog Posts with AI This workflow streamlines your content organization process by automatically analyzing new blog posts in your GitHub repository and assigning appropriate categories and tags using OpenAI. It compares new posts against existing entries in a Google Sheet, updates the metadata for each new article, and records the suggested tags and categories for review — all in one automated pipeline. --- Who’s It For - Content creators and editors managing a static website (e.g., Astro or Next.js) who want AI-driven tagging. - SEO specialists seeking consistent metadata and topic organization. - Developers or teams managing a Markdown-based blog stored in GitHub who want to speed up post curation. --- How It Works 1. Form Trigger – Starts the process manually with a form that initiates article analysis. 2. Get Data from Google Sheets – Retrieves existing post records to prevent duplicate analysis. 3. Compare GitHub and Google Sheets – Lists all .md or .mdx blog posts from the GitHub repository (piotr-sikora.com/src/content/blog/pl/) and identifies new posts not yet analyzed. 4. Check New Repo Files – Uses a code node to filter only unprocessed files for AI tagging. 5. Switch Node – - If there are no new posts, the workflow stops and shows a confirmation message. - If new posts exist, it continues to the next step. 6. Get Post Content from GitHub – Downloads the content of each new article. 7. AI Agent (LangChain + OpenAI GPT-4.1-mini) – - Reads each post’s frontmatter (--- section) and body. - Suggests new categories and tags based on the article’s topic. - Returns a JSON object with proposed updates (Structured Output Parser) 8. Append to Google Sheets – Logs results, including: - File name - Existing tags and categories - Proposed tags and categories (AI suggestions) 9. Completion Message – Displays a success message confirming the categorization process has finished. --- Requirements - GitHub account with repository access to your website content. - Google Sheets connection for storing metadata suggestions. - OpenAI account (credential stored in openAiApi). --- How to Set Up 1. Connect your GitHub, Google Sheets, and OpenAI credentials in n8n. 2. Update the GitHub repository path to match your project (e.g., src/content/blog/en/). 3. In Google Sheets, create columns: - FileName, Categories, Proposed Categories, Tags, Proposed Tags. 4. Adjust the AI model or prompt text if you want different tagging behavior. 5. Run the workflow manually using the Form Trigger node. --- How to Customize - Swap OpenAI GPT-4.1-mini for another LLM (e.g., Claude or Gemini) via the LangChain node. - Modify the prompt in the AI Agent to adapt categorization style or tone. - Add a GitHub commit node if you want AI-updated metadata written back to files automatically. - Use the Schedule Trigger node to automate this process daily. --- Important Notes - All API keys and credentials are securely stored — no hardcoded keys. - The workflow includes multiple sticky notes explaining: - Repository setup - File retrieval and AI tagging - Google Sheet data structure - It uses a LangChain memory buffer to improve contextual consistency during multiple analyses. --- Summary This workflow automates metadata management for blogs or documentation sites by combining GitHub content, AI categorization, and Google Sheets tracking. With it, you can easily maintain consistent tags and categories across dozens of articles — boosting SEO, readability, and editorial efficiency without manual tagging.
How to import this n8n workflow
- 1
Download the workflow JSON file after purchase.
- 2
Open n8n → click the menu → Import from File.
- 3
Select the downloaded JSON and import.
- 4
Set up credentials for each node that requires them.
- 5
Click Execute Workflow to test, then activate.
Setup guide
Setup guide included
Purchase to unlock the full step-by-step guide
Related N8n workflows
Create images from Google Sheets rows using Layerre and save to Google Drive
Generate chat completions with 2 Perplexity AI prompts and update Google Sheets rows
Send data from a custom webhook to Airtable and add a row in Google Sheets
Create a new rows in a Google Sheets spreadsheet from a new member in Invision Community
Log Telegram receipt images to Excel 365 using Tesseract OCR and GPT-4.1-mini
Transform RSS feeds into content with GPT-4o for Medium, LinkedIn & Instagram
Auto workflow backup to Google Drive – automated export of all your workflows
AI-powered multi-channel lead outreach with JotForm, Gemini AI & HeyReach
Reviews
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
- JSON blueprint — instant download
- Setup guide PDF included
- 5 downloads · valid 30 days
- Works with n8n
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.
- Configure live on Google Meet / Zoom
- Free follow-up if workflow has defects
- Platform expert assigned to you