Moderate toxic text, redact PII, and audit with a Gemini HTTP API
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 version with slurs masked and PII redacted.
How it works Receives a POST request on a webhook endpoint with a JSON body containing text and optional context. Sends the input to Google Gemini with instructions to classify safety (allow/flag/block), rate toxicity, identify categories, detect PII, and produce a redacted/masked cleaned_text. Parses Gemini’s response into a structured JSON object with the required moderation fields. Returns the moderation result to the caller as the webhook response. If Gemini fails to classify the text, returns a fail-safe JSON response that flags the content for human review.
Setup Add a Google Gemini (PaLM) API credential for the Google Gemini Chat Model node. Activate the workflow and copy the production webhook URL from the webhook trigger. Configure your client/app to POST JSON (for example { "text": "...", "context": "..." }) to the /moderate endpoint and handle the JSON response.
Related Templates
AI Weather Forecasts with MCP Integration
Real-time Weather Forecasts with MCP Tools This n8n workflow demonstrates how to integrate real-time weather intelligen...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Demo Workflow - How to use workflowStaticData()
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist wi...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments