Skip to main content

Automate image validation tasks using AI Vision

Workflow preview

Workflow preview
100%
Automate image validation tasks using AI Vision preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n workflow shows how using multimodal LLMs with AI vision can tackle tricky image validation tasks which are near impossible to achieve with code and often impractical to be done by humans a...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.set, n8n-nodes-base.splitout, n8n-nodes-base.googledrive, n8n-nodes-base.editimage, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.chainllm

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jimleuk.

Original n8n.io source

1.1 Workflow description

Title
Automate image validation tasks using AI Vision
Workflow name
Automate image validation tasks using AI Vision

This n8n workflow shows how using multimodal LLMs with AI vision can tackle tricky image validation tasks which are near impossible to achieve with code and often impractical to be done by humans at scale.

You may need image validation when users submitted photos or images are required to meet certain criteria before being accepted. A wine review website may require users only submit photos of wine with labels, a bank may require account holders to submit scanned documents for verification etc.

In this demonstration, our scenario will be to analyse a set of portraits to verify if they meet the criteria for valid passport photos according to the UK government website (https://www.gov.uk/photos-for-passports).

How it works

  • Our set of portaits are jpg files downloaded from our Google Drive using the Google Drive node.
  • Each image is resized using the Edit Image node to ensure a balance between resolution and processing speed.
  • Using the Basic LLM node, we'll define a "user message" option with the type of binary (data). This will allow us to pass our portrait to the LLM as an input.
  • With our prompt containing the criteria pulled off the passport photo requirements webpage, the LLM is able to validate the photo does or doesn't meet its criteria.
  • A structured output parser is used to structure the LLM's response to a JSON object which has the "is_valid" boolean property. This can be useful to further extend the workflow.

Requirements

  • Google Gemini API key
  • Google Drive account

Customising this workflow

  • Not using Gemini? n8n's LLM node works with any compatible multimodal LLM so feel free to swap Gemini out for OpenAI's GPT4o or Antrophic's Claude Sonnet.

  • Don't need to validate portraits? Try other use cases such as document classification, security footage analysis, people tagging in photos and more.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 3 - Photo URLs

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Photos To List

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 5 - Download Photos

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 6 - Resize For AI

Type / Role
n8n-nodes-base.editImage - editImage
Config choices
Version 1

Block 7 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Passport Photo Validator

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 11 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

3. Summary Table

Workflow Automate image validation tasks using AI Vision
Complexity intermediate
Nodes 11
Categories Document Extraction, AI Summarization
Author Jimleuk
Published 18 Sept 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2420/2420.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate image validation tasks using AI Vision do?

This n8n workflow shows how using multimodal LLMs with AI vision can tackle tricky image validation tasks which are near impossible to achieve with code and often impractical to be done by humans a...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.