Publish immediately | flagged=true | v [Route by confidence] high -> auto-reject, notify user medium -> hold for human review queue low -> publish, flag for async review

This tiered approach avoids two failure modes at once: auto-publishing everything (no moderation at all) and auto-rejecting everything flagged (too many false positives blocking legitimate content). High-confidence flags can act automatically; medium and low confidence route to a human reviewer instead of an automatic decision.

Logging for Appeals and Audits

Store the full classification result — not just the boolean verdict — alongside the original content and a timestamp:

log_entry = {
    "content_id": content_id,
    "flagged": result["flagged"],
    "categories": result["categories"],
    "confidence": result["confidence"],
    "reasoning": result.get("reasoning"),
    "model": "gemini-2.5-flash",
    "timestamp": datetime.utcnow().isoformat(),
}

When a user appeals a moderation decision, this record is what lets a human reviewer see why the system flagged the content, not just that it did — and it is what you audit against if you later discover the classifier is systematically over- or under-flagging a particular category.

Real-World Use Cases

Best Practices

Common Mistakes

Frequently Asked Questions

Is this the same thing as Gemini's safety settings?

No -- safety settings control what Gemini itself will generate. This pipeline uses Gemini to classify content that came from your own users, a different (though related) use case.

Should I use a small or large model for moderation classification?

A fast, cost-efficient model like Flash is usually sufficient for classification against clear policy categories; reserve larger models for genuinely ambiguous edge cases if you route by confidence.

How do I handle false positives?

Log full reasoning for every decision, provide an appeal path for users, and periodically review flagged content against actual policy violations to catch systematic over-flagging.

Can this pipeline handle images and video, not just text?

Yes -- the same classification pattern works with image and video understanding as input instead of text.

Conclusion

A content moderation pipeline built on Gemini is a classification problem with a human-review safety net, not a single API call you trust blindly: structured output for a reliable verdict, confidence-based routing instead of a binary auto-decision, and full logging so appeals and audits have something to work from. Start with a fast model tuned to your actual policy categories, and route ambiguous cases to a human rather than guessing.

Official Documentation

Written by Abhishek Patoliya, Senior n8n Developer & Automation Architect, Surat, India. Verified n8n Creator.