Piotr Sikora
Templates by Piotr Sikora
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 .md or .mdx blog 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 categories and tags based on the article’s topic. Returns a JSON object with proposed updates (Structured Output Parser) 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.
Collect LinkedIn profiles with SerpAPI Google Search and Sheets
[LI] – Search Profiles > ⚠️ Self-hosted disclaimer: > This workflow uses the SerpAPI community node, which is available only on self-hosted n8n instances. > For n8n Cloud, you may need to use an HTTP Request node with the SerpAPI REST API instead. --- --- Who’s it for Recruiters, talent sourcers, SDRs, and anyone who wants to automatically gather public LinkedIn profiles from Google search results based on keywords — across multiple pages — and log them to a Google Sheet for further analysis. --- What it does / How it works This workflow extends the standard LinkedIn profile search to include pagination, allowing you to fetch results from multiple Google result pages in one go. Here’s the step-by-step process: Form Trigger – “LinkedIn Search” Collects: Keywords (comma separated) – e.g., python, fintech, warsaw Pages to fetch – number of Google pages to scrape (each page ≈ 10 results) Triggers the workflow when submitted. Format Keywords (Set) Converts the keywords into a Google-ready query string: ("python") ("fintech") ("warsaw") These parentheses improve relevance in Google searches. Build Page List (Code) Creates a list of pages to iterate through. For example, if “Pages to fetch” = 3, it generates 3 search batches with proper start offsets (0, 10, 20). Keeps track of: Grouped keywords (keywordsGrouped) Raw keywords Submission timestamp Loop Over Items (Split In Batches) Loops through the page list one batch at a time. Sends each batch to SerpAPI Search and continues until all pages are processed. SerpAPI Search Queries Google with: site:pl.linkedin.com/in/ ("keyword1") ("keyword2") ("keyword3") Fixed to the Warsaw, Masovian Voivodeship, Poland location. The start parameter controls pagination. Check how many results are returned (Switch) If no results → Triggers No profiles found. If results found → Passes data forward. Split Out Extracts each LinkedIn result from the organic_results array. Get Full Name to property of object (Code) Extracts a clean full name from the search result title (text before “–” or “|”). Append profile in sheet (Google Sheets) Saves the following fields into your connected sheet: | Column | Description | |---------|-------------| | Date | Submission timestamp | | Profile | Public LinkedIn profile URL | | Full name | Extracted candidate name | | Keywords | Original keywords from the form | Loop Over Items (continue) After writing each batch, it loops to the next Google page until all pages are complete. Form Response (final step) Sends a confirmation back to the user after all pages are processed: Check linked file --- 🧾 Google Sheets Setup Before using the workflow, prepare your Google Sheet with these columns in row 1: | Column Name | Description | |--------------|-------------| | Date | Automatically filled with the form submission time | | Profile | LinkedIn profile link | | Full name | Extracted name from search results | | Keywords | Original search input | > You can expand the sheet to include optional fields like Snippet, Job Title, or Notes if you modify the mapping in the Append profile in sheet node. --- Requirements SerpAPI account – with API key stored securely in n8n Credentials. Google Sheets OAuth2 credentials – connected to your target sheet with edit access. n8n instance (Cloud or self-hosted) > Note: SerpAPI node is part of the Community package and may require self-hosted n8n. --- How to set up Import the [LI] - Search profiles workflow into n8n. Connect your credentials: SerpAPI – use your API key. Google Sheets OAuth2 – ensure you have write permissions. Update the Google Sheets node to point to your own spreadsheet and worksheet. (Optional) Edit the location field in SerpAPI Search for different regions. Activate the workflow and open the public form (via webhook URL). Enter your keywords and specify the number of pages to fetch. --- How to customize the workflow Change search region: Modify the location in the SerpAPI node or change the domain to site:linkedin.com/in/ for global searches. Add pagination beyond 3–4 pages: Increase “Pages to fetch” — but note that excessive pages may trigger Google rate limits. Avoid duplicates: Add a Google Sheets → Read + IF node before appending new URLs. Add notifications: Add Slack, Discord, or Email nodes after Google Sheets to alert your team when new data arrives. Capture more data: Map additional fields like title, snippet, or position into your Sheet. --- Security notes Never store API keys directly in nodes — always use n8n Credentials. Keep your Google Sheet private and limit edit access. Remove identifying data before sharing your workflow publicly. --- 💡 Improvement suggestions | Area | Recommendation | Benefit | |-------|----------------|----------| | Dynamic location | Add a “Location” field to the form and feed it to SerpAPI dynamically. | Broader and location-specific searches | | Rate limiting | Add a short Wait node (e.g., 1–2s) between page fetches. | Prevents API throttling | | De-duplication | Check for existing URLs before appending. | Prevents duplicates | | Logging | Add a second sheet or log file with timestamps per run. | Easier debugging and tracking | | Data enrichment | Add a LinkedIn or People Data API enrichment step. | Collect richer candidate data | --- ✅ Summary: This workflow automates the process of searching public LinkedIn profiles from Google across multiple pages. It formats user-entered keywords into advanced Google queries, iterates through paginated SerpAPI results, extracts profile data, and stores it neatly in a Google Sheet — all through a single, user-friendly form.
Export WordPress posts with categories and tags to Google Sheets for SEO audits
Who’s it for This workflow is perfect for content managers, SEO specialists, and website owners who want to easily analyze their WordPress content structure. It automatically fetches posts, categories, and tags from a WordPress site and exports them into a Google Sheet for further review or optimization. What it does This automation connects to the WordPress REST API, collects data about posts, categories, and tags, and maps the category and tag names directly into each post. It then appends all this enriched data to a Google Sheet — providing a quick, clean way to audit your site’s content and taxonomy structure. How it works Form trigger: Start the workflow by submitting a form with your website URL and the number of posts to analyze. Fetch WordPress data: The workflow sends three API requests to collect posts, categories, and tags. Merge data: It combines all the data into one stream using the Merge node. Code transformation: A Code node replaces category and tag IDs with their actual names. Google Sheets export: Posts are appended to a Google Sheet with the following columns: URL Title Categories Tags Completion form: Once the list is created, you’ll get a confirmation message and a link to your sheet. If the WordPress API isn’t available, the workflow automatically displays an error message to help you troubleshoot. Requirements A WordPress site with the REST API enabled (/wp-json/wp/v2/). A Google account connected to n8n with access to Google Sheets. A Google Sheet containing the columns: URL, Title, Categories, Tags. How to set up Import this workflow into n8n. Connect your Google Sheets account under credentials. Make sure your WordPress site’s API is accessible publicly. Adjust the Post limit (per_page) in the form node if needed. Run the workflow and check your Google Sheet for results. How to customize Add additional WordPress endpoints (e.g., authors, comments) by duplicating and modifying HTTP Request nodes. Replace Google Sheets with another integration (like Airtable or Notion). Extend the Code node to include SEO metadata such as meta descriptions or featured images.