n8n automation hub on the AI platformworkflows that use the platform's two doors under one identity · a person approves every reply · the hub's workflows become MCP tools

n8n 2.49 queue modeplatform-auth sidecarLLM door (project 2)MCP gateway (project 1)Presidio /maskKeycloak service accountPostgres · RedisGKE Autopilot · Cloudflare Tunnel

Repo: github.com/bhavishyajain545/gcp-ai-n8n-hub · rebuild: REBUILD.md · project 1: MCP gateway · project 2: LLM router

Demo (narrated)

Measured on the recorded run

55 s
from form submit to a draft waiting for the reviewer (classify, one order lookup through MCP, draft)
≈ 4.9k
tokens a ticket costs at the door (3 model calls); the hub is one tenant with 50k tokens per hour
0
model calls that carried the customer's name, e-mail or phone (Presidio masks inside the workflow first)
35
tools a mcp-user sees through the gateway, hub workflows included
6.8 s
to list the other tools while the hub is down (failOpen + 3 s connect timeout; before: HTTP 500 for everyone)
≈ 30 s
for the ops digest called as an MCP tool from outside n8n

How it works

The triage workflow in n8n

n8n editor: Customer form → Ticket → Save ticket → Mask personal data → Classify (model auto) → Triage agent with MCP tool → Re-identify → Queue for review → Human approval → Record decision
stepwhat happenswhere
form + ticketpublic n8n form; ticket row in hub.ticketsn8n · Postgres
maskpresidio-guard /mask: name, e-mail, phone become <PERSON>, <EMAIL_ADDRESS>, <IN_PHONE> before any model sees them; the door's own guard cannot rewrite an agent's tool roundsproject 2
classifymodel auto: the semantic router picks the tier; structured output category + urgencyLLM door
triage agentgemini-3.5-flash with one MCP tool, ops-db_query_readonly, called through the gateway as service-account-n8n (role mcp-user, audited); one tool per step (Gemini 3 thought signatures)LLM door · MCP gateway
re-identifyplaceholders back to the real first name, e-mail, phone, inside n8nn8n
human approvaln8n Wait (form) linked from the inbox: edit the reply, Send or Rejectn8n

Run it like a service

Lessons

symptomcausefix
n8n: Unexpected token \u001f … is not valid JSONthe sidecar streamed gzip bytes but dropped Content-Encodingask upstream for identity
Presidio logged unmasked in the agent's later roundsthe door's guard can only rewrite role+content messagesmask once inside the workflow
Vertex 400 "missing thought_signature"Gemini 3 signs only the first of parallel tool calls"call exactly ONE tool per step" (3/3)
gateway tools/list 500 for everyone while n8n restartedone target down failed the fan-outfailureMode: failOpen + connect timeout (62 s → 3.6 s)
namespace <PERSON> in the ops digestNER read Keycloak, mcp, FailedScheduling as namesallow-list + CamelCase rule in presidio-guard
approvals recorded as rejectedn8n form answers are keyed by label, not field name$json['Decision']
Built on GKE Autopilot in project bj-ai-platform · n8n is used under its Sustainable Use License (self-hosted, internal use) · source