Auto-Categorize Blog Posts
Scans new Markdown blog posts in GitHub, uses GPT-4 to suggest categories and tags, and logs them to Google Sheets for review.
What it does
You save time on manual tagging as this agent scans your new GitHub blog posts to suggest relevant categories and tags via GPT-4. It logs these AI-generated recommendations directly into Google Sheets for your review while automatically preventing duplicate analysis of existing files.
Step by step
- Configure the Form Trigger to listen for webhook events from GitHub on push or pull_request actions.
- Set up the GitHub Get Content node with a repository path filter targeting the posts directory.
- Implement a Code Filter step that compares file hashes against existing Google Sheet entries to skip processed items.
Where the LLM does the work
- Prompt the OpenAI Chat Model to extract semantic categories and specific tags from the Markdown content.
- Instruct the LLM to output results in a structured JSON format compatible with your spreadsheet columns.
- Refine the prompt to ensure consistent capitalization and avoid overly generic tags like 'news' or 'update'.
Watch out for
Tools that fit
The agent brief
You are helping me build the following AI agent workflow. ## Goal Auto-Categorize Blog Posts: Scans new Markdown blog posts in GitHub, uses GPT-4 to suggest categories and tags, and logs them to Google Sheets for review. ## Specification - What it does: You save time on manual tagging as this agent scans your new GitHub blog posts to suggest relevant categories and tags via GPT-4. It logs these AI-generated recommendations directly into Google Sheets for your review while automatically preventing duplicate analysis of existing files. - Trigger: Run manually (Manual · on demand) - Autonomy: You stay in control - Expected setup effort: about an afternoon - Tools/services involved: - GitHub: Retrieve blog post content and metadata - Google Sheets: Store existing tags and log AI suggestions - OpenAI Chat Model: Analyze content and suggest categories/tags ## Known pitfalls, handle each one explicitly in your implementation 1. Markdown frontmatter might contain metadata that confuses the categorizer, so strip it before sending content to the LLM. 2. Google Sheets append operations can fail if column headers change, so validate the sheet structure in a dry run first. ## Reference implementation https://n8n.io/workflows/9983 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/auto-categorize-blog-posts-with-ai/ via usecasesforagents.com
Frequently asked questions
Can I use a different Spreadsheet than Google Sheets?
Yes. Google Sheets is only the example spreadsheet in this recipe. The same flow works with Airtable, Baserow and Excel. Swap the spreadsheet connection and keep the rest of the setup as written.
Want this running in your business?
Who it's for
Built for developers who want the busywork around code automated, not the code itself.
Marketers can point this at their own content pipeline with no changes to the pattern.