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.
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
- Form Trigger – Starts the process manually with a form that initiates article analysis.
- Get Data from Google Sheets – Retrieves existing post records to prevent duplicate analysis.
- Compare GitHub and Google Sheets – Lists all
.mdor.mdxblog posts from the GitHub repository (piotr-sikora.com/src/content/blog/pl/) and identifies new posts not yet analyzed. - Check New Repo Files – Uses a code node to filter only unprocessed files for AI tagging.
- 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.
- Get Post Content from GitHub – Downloads the content of each new article.
- AI Agent (LangChain + OpenAI GPT-4.1-mini) –
- Reads each post’s frontmatter (
---section) and body. - Suggests new
categoriesandtagsbased on the article’s topic. - Returns a JSON object with proposed updates (Structured Output Parser)
- Reads each post’s frontmatter (
- Append to Google Sheets – Logs results, including:
- File name
- Existing tags and categories
- Proposed tags and categories (AI suggestions)
- 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
- Connect your GitHub, Google Sheets, and OpenAI credentials in n8n.
- Update the GitHub repository path to match your project (e.g.,
src/content/blog/en/). - In Google Sheets, create columns:
FileName,Categories,Proposed Categories,Tags,Proposed Tags.
- Adjust the AI model or prompt text if you want different tagging behavior.
- 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.
Auto-Categorize Blog Posts with OpenAI GPT-4, GitHub, and Google Sheets
This n8n workflow automates the process of categorizing blog posts by leveraging OpenAI's GPT-4, pulling data from GitHub, and storing the categorized information in Google Sheets. It's designed to streamline content management for projects like "astronextjs" by automatically enriching blog post metadata.
What it does
- Triggers on Form Submission: The workflow starts when an n8n form is submitted. This form is expected to contain the URL of a new blog post.
- Fetches Blog Post Content from GitHub: It retrieves the content of the specified blog post from a GitHub repository.
- Analyzes Content with OpenAI GPT-4: The blog post content is then fed into an OpenAI GPT-4 agent. This agent is configured with a structured output parser and simple memory to generate relevant categories for the post.
- Processes AI Output: The AI-generated categories are processed and structured.
- Splits Categories into Batches: If multiple categories are generated, they are split into individual items for further processing.
- Checks for Existing Categories in Google Sheets: For each generated category, the workflow queries a Google Sheet to see if the category already exists.
- Conditionally Adds New Categories:
- If a category does not exist in the Google Sheet, it is added as a new entry.
- If the category already exists, no action is taken.
- Aggregates Categorized Data: All the processed categories (newly added or existing) are aggregated.
- Updates Google Sheet with Blog Post and Categories: Finally, the original blog post URL along with its newly assigned (or existing) categories is added to a Google Sheet, creating a comprehensive record.
Prerequisites/Requirements
- n8n Instance: A running n8n instance.
- GitHub Account & Repository: Access to a GitHub repository containing your blog posts.
- OpenAI API Key: An API key for OpenAI with access to GPT-4.
- Google Account: Access to Google Sheets for storing categories and blog post data.
- Google Sheets: Two dedicated Google Sheets:
- One for storing a master list of categories.
- One for storing blog post URLs and their assigned categories.
Setup/Usage
- Import the Workflow: Download the provided JSON and import it into your n8n instance.
- Configure Credentials:
- GitHub: Set up your GitHub credential to allow n8n to read repository content.
- OpenAI: Configure your OpenAI credential with your API key.
- Google Sheets: Set up your Google Sheets credential to allow n8n to read from and write to your spreadsheets.
- Configure GitHub Node (Node 16 - "GitHub"):
- Specify the Repository and File Path where your blog posts are located.
- Configure OpenAI Chat Model (Node 1153 - "OpenAI Chat Model"):
- Ensure the correct Model (e.g.,
gpt-4) is selected.
- Ensure the correct Model (e.g.,
- Configure Google Sheets Nodes:
- Google Sheets (Node 18 - "Google Sheets"): For checking existing categories, specify the Spreadsheet ID and Sheet Name of your master categories sheet.
- Google Sheets (Node 18 - "Google Sheets"): For adding new categories, specify the Spreadsheet ID and Sheet Name of your master categories sheet.
- Google Sheets (Node 18 - "Google Sheets"): For updating blog post data, specify the Spreadsheet ID and Sheet Name of your blog post records sheet.
- Configure n8n Form Trigger (Node 1225 - "On form submission"):
- Define the form fields, expecting at least a field for the blog post URL.
- Activate the Workflow: Once all configurations are complete, activate the workflow.
- Submit the Form: Use the generated n8n form URL to submit new blog post URLs and trigger the categorization process.
Related Templates
Auto-create TikTok videos with VEED.io AI avatars, ElevenLabs & GPT-4
💥 Viral TikTok Video Machine: Auto-Create Videos with Your AI Avatar --- 🎯 Who is this for? This workflow is for content creators, marketers, and agencies who want to use Veed.io’s AI avatar technology to produce short, engaging TikTok videos automatically. It’s ideal for creators who want to appear on camera without recording themselves, and for teams managing multiple brands who need to generate videos at scale. --- ⚙️ What problem this workflow solves Manually creating videos for TikTok can take hours — finding trends, writing scripts, recording, and editing. By combining Veed.io, ElevenLabs, and GPT-4, this workflow transforms a simple Telegram input into a ready-to-post TikTok video featuring your AI avatar powered by Veed.io — speaking naturally with your cloned voice. --- 🚀 What this workflow does This automation links Veed.io’s video-generation API with multiple AI tools: Analyzes TikTok trends via Perplexity AI Writes a 10-second viral script using GPT-4 Generates your voiceover via ElevenLabs Uses Veed.io (Fabric 1.0 via FAL.ai) to animate your avatar and sync the lips to the voice Creates an engaging caption + hashtags for TikTok virality Publishes the video automatically via Blotato TikTok API Logs all results to Google Sheets for tracking --- 🧩 Setup Telegram Bot Create your bot via @BotFather Configure it as the trigger for sending your photo and theme Connect Veed.io Create an account on Veed.io Get your FAL.ai API key (Veed Fabric 1.0 model) Use HTTPS image/audio URLs compatible with Veed Fabric Other APIs Add Perplexity, ElevenLabs, and Blotato TikTok keys Connect your Google Sheet for logging results --- 🛠️ How to customize this workflow Change your Avatar: Upload a new image through Telegram, and Veed.io will generate a new talking version automatically. Modify the Script Style: Adjust the GPT prompt for tone (educational, funny, storytelling). Adjust Voice Tone: Tweak ElevenLabs stability and similarity settings. Expand Platforms: Add Instagram, YouTube Shorts, or X (Twitter) posting nodes. Track Performance: Customize your Google Sheet to measure your most successful Veed.io-based videos. --- 🧠 Expected Outcome In just a few seconds after sending your photo and theme, this workflow — powered by Veed.io — creates a fully automated TikTok video featuring your AI avatar with natural lip-sync and voice. The result is a continuous stream of viral short videos, made without cameras, editing, or effort. --- ✅ Import the JSON file in n8n, add your API keys (including Veed.io via FAL.ai), and start generating viral TikTok videos starring your AI avatar today! 🎥 Watch This Tutorial --- 📄 Documentation: Notion Guide Need help customizing? Contact me for consulting and support : Linkedin / Youtube
Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets
This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.
Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax
Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions