Skip to main content

What you’ll build

You’ll build a comprehensive KYB (Know Your Business) verification workflow that processes multiple identity documents in parallel using AI vision models. The workflow analyzes Emirates ID, trade license, and passport documents simultaneously, merges the results, and routes them through confidence-based validation before sending verification results. This workflow demonstrates how to:
  • Process multiple documents concurrently for faster verification
  • Use private vision models for sensitive identity data
  • Implement human-in-the-loop approval for low-confidence cases
  • Automate the verification notification process
KYB Document Verification Workflow

Prerequisites

Before you begin, ensure you have:
  • MagOneAI instance with access to the workflow builder
  • Vision model access — either:
    • Private vision model (Qwen3-VL recommended for sensitive documents)
    • Cloud vision model (GPT-4V, Claude 3.5 Sonnet)
  • Email tool configured for sending verification results
  • Sample documents for testing (Emirates ID, trade license, passport)
For KYB workflows handling sensitive identity documents, we strongly recommend using a privately hosted vision model to ensure data privacy and compliance.

Architecture

The KYB verification workflow follows a parallel processing pattern that maximizes efficiency while maintaining accuracy:

Workflow components

Parallel Processing

Three document analysis agents run simultaneously to reduce total processing time from ~45s to ~15s

Vision Models

Each agent uses vision capabilities to extract text, verify authenticity, and validate document structure

Confidence Routing

Automatically routes low-confidence results to human reviewers while approving high-confidence cases

Audit Trail

Captures all verification steps, confidence scores, and approval decisions for compliance

Step-by-step build

1

Create the project and agents

Start by creating a new project in MagOneAI and setting up the four agents you’ll need.Navigate to ProjectsCreate New Project → Name it “KYB Document Verification”Create four agents:
  1. Emirates ID Analyzer
    • Name: Emirates ID Analyzer
    • Model: Qwen3-VL (private) or GPT-4V
    • Persona:
  2. Trade License Analyzer
    • Name: Trade License Analyzer
    • Model: Qwen3-VL (private) or GPT-4V
    • Persona:
  3. Passport Analyzer
    • Name: Passport Analyzer
    • Model: Qwen3-VL (private) or GPT-4V
    • Persona:
  4. Merge & Summary Agent
    • Name: KYB Summary Agent
    • Model: GPT-4 or Claude 3.5 Sonnet (text model)
    • Persona:
2

Build the workflow foundation

Open the workflow builder and add the initial nodes.
  1. Add Trigger Node
    • Type: Manual Trigger (or API trigger if integrating with your system)
    • Configure inputs:
      • emirates_id_image (file)
      • trade_license_image (file)
      • passport_image (file)
      • applicant_name (text)
      • application_id (text)
  2. Add Parallel Node
    • Drag a Parallel Node onto the canvas
    • Connect it to the trigger
    • You’ll configure the branches in the next step
3

Configure parallel document analysis branches

Set up three parallel branches, one for each document type.In the Parallel Node configuration:
  1. Branch 1 - Emirates ID
    • Add Agent Node: Emirates ID Analyzer
    • Map input: {{trigger.emirates_id_image}}
    • Enable vision mode
  2. Branch 2 - Trade License
    • Add Agent Node: Trade License Analyzer
    • Map input: {{trigger.trade_license_image}}
    • Enable vision mode
  3. Branch 3 - Passport
    • Add Agent Node: Passport Analyzer
    • Map input: {{trigger.passport_image}}
    • Enable vision mode
All three branches execute simultaneously, reducing total processing time significantly.
4

Add merge agent to consolidate results

After the Parallel Node, add the merge agent to consolidate findings.
  1. Add Agent Node: KYB Summary Agent
  2. Configure inputs to receive all three parallel outputs:
  3. Enable structured output to ensure consistent JSON format
5

Add confidence-based routing

Add a Condition Node to route based on confidence scores.
  1. Add Condition Node after the merge agent
  2. Configure condition:
  3. Label branches clearly: “Auto-Approve” and “Human Review”
Set your confidence threshold based on your risk tolerance. Higher thresholds (90+) reduce false positives but increase manual reviews.
6

Configure human review for low-confidence cases

On the “Human Review” branch, add a Human Task node.
  1. Add Human Task Node
  2. Configure task:
    • Title: KYB Document Review Required
    • Description:
    • Task type: Approval
    • Assignee: A compliance reviewer’s user ID (a template like {{system.user_id}} also works; assign one or more reviewers)
    • Context fields: Surface the merge agent output and document analyses for the reviewer (the previous activity output is included automatically)
    • Decision question: A choice question with options Approve, Reject, and Request More Info, wired to approval branches
  3. Add merge point after Human Task to rejoin with auto-approve branch
7

Add email notification

Add a final Tool Node to send verification results.
  1. Add Tool Node: Email
  2. Configure email:
    • To: {{trigger.applicant_email}}
    • Subject:
    • Body:
  3. Add condition to customize email based on approval/rejection status
8

Test with sample documents

Test your workflow with sample documents to verify it works correctly.
  1. Prepare test documents:
    • Sample Emirates ID (use test data, not real IDs)
    • Sample trade license
    • Sample passport
  2. Run the workflow with test inputs
  3. Verify:
    • All three agents execute in parallel
    • Merge agent consolidates results correctly
    • Condition routing works based on confidence
    • Email notification sends successfully
  4. Test edge cases:
    • Expired document
    • Low-quality image
    • Missing document
    • Mismatched names across documents
Monitor the execution logs to see parallel execution timing. You should see all three document agents start within milliseconds of each other.

Key concepts demonstrated

Private Model Deployment

Deploy vision models (like Qwen3-VL) on your own infrastructure to ensure sensitive identity documents never leave your network.

Parallel Execution

Process multiple documents simultaneously using the Parallel Node, reducing total workflow time by 60-70%.

Condition-Based Routing

Dynamically route execution based on AI confidence scores, balancing automation with human oversight.

Human-in-the-Loop

Seamlessly escalate low-confidence cases to human reviewers while auto-processing high-confidence ones.

Vision Model Integration

Use multimodal AI models to analyze document images, extract text, and verify authenticity markers.

Tool Integration

Connect to email, ticketing, or CRM systems to automate downstream notifications and record-keeping.

Customization ideas

Take this workflow further by adding these enhancements:
Extend the parallel processing to include additional documents:
  • Utility bills for address verification
  • Bank statements for financial verification
  • Articles of Association for corporate structure
  • Shareholder certificates
Simply add more branches to the Parallel Node and create specialized agents for each document type.
Connect to external databases for enhanced verification:
  • UAE government databases (if you have API access)
  • International sanctions lists
  • Corporate registry lookups
  • Credit bureau checks
Add Tool Nodes or API calls after document extraction to cross-reference extracted data.
For low-quality images, add a preprocessing step:
  • Image enhancement (contrast, brightness, deskew)
  • OCR with Tesseract or cloud OCR services
  • Text extraction before vision model analysis
This improves accuracy for scanned or photographed documents.
Automate compliance workflows:
  • Log all verifications to compliance management systems
  • Trigger AML/CFT screening workflows
  • Generate audit reports automatically
  • Archive documents in compliant storage
Add Tool Nodes to integrate with your compliance infrastructure.
Handle documents in multiple languages:
  • Add language detection in document analysis agents
  • Configure agents with multilingual capabilities
  • Translate extracted data to a common language for cross-validation
  • Support Arabic, English, and other languages common in UAE business
Enhance security with dedicated fraud detection:
  • Create a fraud detection agent that analyzes document metadata
  • Check for common forgery patterns
  • Validate photo quality and tampering signs
  • Calculate fraud risk score
  • Flag high-risk applications for enhanced review

Next steps

Now that you’ve built a KYB verification workflow, explore these related cookbooks:
Need help? Join our community or contact support for assistance with implementing KYB workflows in production.