Moderate toxic text, redact PII, and audit with a Gemini HTTP API
Ready for 3.0What this workflow does
This AI workflow has 12 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Google Gemini Chat Model, Google Sheets and Slack.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Normalize Request (Code): runs custom JavaScript code
- Moderate Text with Gemini (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Moderation Parser
- Shape Result (Code): runs custom JavaScript code
- Log to Audit Trail (Google Sheets): append
- Bundle Results (Aggregate): combines items into one
- Build API Response (Code): runs custom JavaScript code
- Return Result (Respond to Webhook): sends the response back to the webhook caller
- Any Blocked (If): checks a condition and branches into true / false
- Alert on Blocked Content (Slack): uses Slack
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (10)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Aggregate
n8n-nodes-base.aggregate - Respond to Webhook
n8n-nodes-base.respondToWebhook - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack
From the author
Quick Overview This workflow exposes a POST webhook that sends user text (and optional context) to Google Gemini for moderation, returning an allow/flag/block decision, toxicity level, matched categories, detected PII types, a short reason, and a cleaned…