πŸ“– Run a skills-based knowledge chatbot with Google Sheets and GPT-4o-mini

⚑ 53 views Β· πŸ“– Internal Wiki & Knowledge Base

Description

Quick overview

This workflow creates a session-based chatbot in n8n Chat that loads β€œskills” from Google Sheets and uses OpenAI GPT-4o-mini to respond strictly according to the matched skill’s trigger phrases and instructions.

How it works

  1. Receives each message from the built-in n8n Chat trigger.
  2. Retrieves all rows from a Google Sheets document that contains a Skills tab.
  3. Filters the rows to skills marked Active = Yes and formats them into a structured skills context for the agent.
  4. Uses an OpenAI GPT-4o-mini powered agent with session memory to match the user message to the best skill via trigger phrases and generate a response that follows the skill instructions exactly.
  5. Sends the agent’s output back to the n8n chat interface.

Setup

  1. Create a Google Sheet with a Skills tab and columns for Skill Name, Trigger Phrases, Instructions, Example Output, and Active (set to Yes for enabled skills).
  2. Add a Google Sheets OAuth credential and replace YOUR_SKILLS_SHEET_ID with your spreadsheet ID.
  3. Add an OpenAI credential and ensure the model is set to gpt-4o-mini.
  4. Activate the workflow and use the Chat Trigger URL to start a conversation.

Requirements

Customization

Additional info

Trigger phrases drive skill matching β€” the more specific and varied your trigger phrases are, the more accurately the agent picks the right skill. For example, instead of just β€œemail” use β€œcold email, outreach email, sales email, prospecting email” to cover different ways users might phrase the same request.

If a user message could match multiple skills, the agent picks the most relevant one based on the full message context. If you notice the wrong skill being selected, make the trigger phrases of each skill more distinct from each other.

The Active column controls which skills are loaded on each run. Setting a row to anything other than Yes β€” including No, Inactive, or leaving it blank β€” silently excludes it. You can use this to turn skills on and off without deleting them.

The workflow reads the full Skills tab on every single chat message. For large skill sheets with many rows this adds a small delay. If you have more than 50 skills and notice slow responses, consider archiving inactive skills to a separate tab to keep the active tab lean.

πŸ”— Nodes Used

Google Sheets, AI Agent, OpenAI Chat Model, Simple Memory, Chat Trigger, Chat

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup