Block 1 - Guardrails
- Type / Role
- @n8n/n8n-nodes-langchain.guardrails - guardrails
- Config choices
- Version 1
This workflow is provided as-is. Please review and test before using in production.
Description This workflow acts as an autonomous Tier 2 Customer Support Agent. It doesn't just answer questions; it manages the entire lifecycle of a support ticket—from triage to resolution with G...
@n8n/n8n-nodes-langchain.guardrails, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.toolworkflow, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.gmailtrigger, n8n-nodes-base.gmailtool, n8n-nodes-base.slacktool, @n8n/n8n-nodes-langchain.lmchatgooglegemini
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by RamS.
Original n8n.io sourceThis workflow acts as an autonomous Tier 2 Customer Support Agent. It doesn't just answer questions; it manages the entire lifecycle of a support ticket—from triage to resolution with Guardrails to deal with prompt injections, PII information blocking, etc. enabling such threats are blocked and logged in Airtable.
Unlike standard auto-responders, this system uses a "Master Orchestrator" architecture to coordinate specialized sub-agents. It creates a safe, human-like support experience by combining RAG (Knowledge Base retrieval) with a safety-first state machine.
The workflow operates on a strict "Hub and Spoke" model managed by a Master Orchestrator:
Security Guardrails (The Gatekeeper) Before the AI even sees the message, a hard-coded security layer scans for Prompt Injection attacks, Profanity, and PII. If a threat is detected, the workflow locks down, logs the incident to Airtable, and stops execution immediately.
Orchestration & Triage Once the message passes safety checks, the Master Orchestrator takes over. Its first action is to call the Ticket Analyser Agent.
Analysis & Scoring The Ticket Analyser classifies the issue (e.g., "Technical," "Billing") and scores the customer's sentiment. It returns a priority_score to the Master Orchestrator.
The Decision Logic (Circuit Breaker) The Master Orchestrator evaluates the score:
Escalation: If the customer is "Furious" or the score is high, it bypasses AI drafting and immediately alerts a human manager via Slack.
Resolution Path: If the request is standard, it proceeds to the next steps.
Knowledge Retrieval (RAG) The Orchestrator calls the Knowledge Worker Agent. This agent searches your Supabase vector store to find specific, verified company policies or troubleshooting steps relevant to the user's issue.
Resolution Drafting Armed with the analysis and the retrieved facts, the Orchestrator calls the Resolution Agent. This agent synthesizes a polite, professional email draft.
Final Execution The Master Orchestrator reviews the final draft and sends the email via Gmail.
This is multi-agent system. Please follow these steps to configure the environment:
⚠️ IMPORTANT: This template contains the Main Orchestrator AND the Sub-Agents in a single view. You must separate them for the system to function:
Separate the Agents: Copy the nodes for each sub-agent (Ticket Analyser, Knowledge Worker, Resolution Agent) into their own new workflows.
Link the Tools: In the Main Orchestrator workflow, open the "Call [Agent Name]" tool nodes and update the Workflow ID to point to the new workflows you just created.
Configure Credentials: You will need credentials for Gmail (or your preferred email provider), Slack, Airtable, Supabase (for the vector store), and Google Gemini (or OpenAI).
Initialize the Knowledge Base:
Open the "One time Document Loader" section in the workflow.
Upload your policy document (PDF/Text) to the "Upload your file here" node.
Run this branch once to vectorize your documents into Supabase.
Setup Airtable: Create a simple table with columns for Sender Email, Incident Type, and Flagged Content to log security threats caught by the guardrails.
Customize the Trigger: Update the Gmail Trigger node to watch for your specific support alias (e.g., [email protected]) and ensure it only picks up "Unread" emails.
Adjust the Escalation Sensitivity: In the Orchestrator Agent node, you can tweak the "Phase 2" logic to change what triggers a human hand-off (currently set to priority_score >= 0.9).
Good to go!
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.
| Workflow | Automated customer support system with Gemini AI, RAG & security guardrails |
|---|---|
| Complexity | advanced |
| Nodes | 38 |
| Categories | Support Chatbot, AI Chatbot |
| Author | RamS |
| Published | 07 Dec 2025 |
Use the JSON export at /data/workflows/11580/11580.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Description This workflow acts as an autonomous Tier 2 Customer Support Agent. It doesn't just answer questions; it manages the entire lifecycle of a support ticket—from triage to resolution with G...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.