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
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments