๐ฌ Unpublish NSFW ImageKit uploads with GPT-4o Vision via OpenRouter
โก 43 views ยท ๐ฌ Document Extraction & Analysis
Description
Quick Overview
This workflow triggers on new ImageKit uploads, downloads the image, uses OpenRouter (OpenAI GPT-4o) vision to run an NSFW check, and automatically unpublishes flagged assets in ImageKit so they are not served via your CDN.
How it works
- Triggers when ImageKit emits a
file.createdevent for a newly uploaded asset. - Downloads the uploaded image from the ImageKit URL as binary data.
- Sends the image to OpenRouter using the OpenAI GPT-4o model to return a structured JSON verdict (
is_nsfw,confidence, andreason). - Checks the model verdict and, when
is_nsfwis true, updates the ImageKit file to set it as unpublished. - Ends without taking action when the image is not flagged.
Setup
- Add ImageKit credentials for both the ImageKit trigger (webhook) and the ImageKit API operation used to unpublish files.
- Create an OpenRouter credential with access to the
openai/gpt-4omodel. - In ImageKit, register the n8n webhook URL for
file.createdevents and ensure new uploads default to published if you want this workflow to act as the gatekeeper.
๐ Nodes Used
HTTP Request, AI Agent, Structured Output Parser, OpenRouter Chat Model
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File