{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e119d712-3fde-49d3-8682-cb2f4990db75",
      "name": "\ud83c\udd94 Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        300
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 720,
        "content": "## \ud83c\udd94 AI Driver License Processing with VLM Run\n\n**Overview:**\nAutomatically processes driver license images /PDFs uploaded to Google Drive and extracts key information using AI-powered OCR.\n\n**Workflow:**\n1. \ud83d\udcc1 Monitor Google Drive folder\n2. \u2b07\ufe0f Download new license images/PDFs\n3. \ud83e\udd16 Process document asynchronously using VLM Run\n4. \ud83d\udd17 Receive extracted data via webhook\n5. \ud83d\udcca Store results in Google Sheets\n\n**Perfect for:**\n- Identity verification\n- Customer onboarding\n- Document processing\n- Data entry automation\n- Compliance tracking\n\n**Requirements:**\n- VLM Run API access\n- Google Drive OAuth2\n- Google Sheets access\n- Webhook endpoint"
      },
      "typeVersion": 1
    },
    {
      "id": "ac367e92-0705-49b6-bcf0-c90848bdf641",
      "name": "\ud83d\udcc1 Input Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        300
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 720,
        "content": "## \ud83d\udcc1 Document Input Processing\n\n**Monitors Google Drive folder and downloads license images for AI analysis.**\n\n**Process:**\n1. Watches for new image files\n2. Auto-triggers on upload\n3. Downloads for processing\n\n**Supported Formats:**\n- JPG, PNG, PDF\n- HEIC, WebP\n- High resolution scans\n- Mobile photos\n- Front/back images"
      },
      "typeVersion": 1
    },
    {
      "id": "2415f1ee-c8b3-4ac7-878a-022a4fec22a8",
      "name": "\ud83e\udd16 AI Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        300
      ],
      "parameters": {
        "color": 2,
        "width": 320,
        "height": 720,
        "content": "## \ud83e\udd16 AI Document Analysis\n\n**VLM Run processes license images to extract structured data.**\n\n**Extracted Fields:**\n- License number\n- Full name\n- Date of birth\n- Issue date\n- Expiration date\n\n**Features:**\n- High accuracy OCR\n- Multi-state support\n- Error validation\n- Structured output\n\n**Benefits:**\n- Eliminates manual entry\n- Reduces errors\n- Instant processing\n- Compliance ready"
      },
      "typeVersion": 1
    },
    {
      "id": "e1447ff9-e842-4e5c-9cdc-685101c055ad",
      "name": "\ud83d\udd17 Async Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        300
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 720,
        "content": "## \ud83d\udd17 Async Processing Flow\n\n**How asynchronous processing works:**\n\n**Step 1:** Image sent to VLM Run with callback URL\n**Step 2:** OCR processing starts in background\n**Step 3:** Webhook receives extracted data\n**Step 4:** Results saved to Google Sheets\n\n**Why Async?**\n- Handles large image files\n- Prevents timeouts\n- Better resource usage\n- Reliable extraction\n- Queue management"
      },
      "typeVersion": 1
    },
    {
      "id": "3df416dc-0ee6-4d74-8065-7c65b3150c82",
      "name": "\ud83d\udcca Output Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        300
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 720,
        "content": "## \ud83d\udcca Data Storage\n\n**Stores extracted license data in Google Sheets for easy access.**\n\n**Sheet Columns:**\n- License Number\n- Full Name\n- Date of Birth\n- Issue Date\n- Expiration Date\n\n**Benefits:**\n- Searchable database\n- Easy exports\n- Team access\n- Audit trail\n- Integration ready"
      },
      "typeVersion": 1
    },
    {
      "id": "990c51d7-07fa-4871-a65d-4241b54e76d7",
      "name": "VLM Run License Extractor",
      "type": "@vlm-run/n8n-nodes-vlmrun.vlmRun",
      "notes": "Processes driver license images using VLM AI to extract structured data including license number, name, DOB, and dates. Runs asynchronously for reliable processing.",
      "position": [
        680,
        840
      ],
      "parameters": {
        "domain": "document.us-drivers-license",
        "callbackUrl": "https://playground.vlm.run/webhook/extract-us-driver-license",
        "processAsynchronously": true
      },
      "credentials": {
        "vlmRunApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6b5599f2-9b37-45cd-81fa-1322fc9a9378",
      "name": "Monitor License Uploads",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "notes": "Watches designated Google Drive folder for new driver license images and triggers processing automatically when files are uploaded.",
      "position": [
        260,
        840
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1reWORwI1tMa-eGB75NCXq9eRw4CiQIhX",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1reWORwI1tMa-eGB75NCXq9eRw4CiQIhX",
          "cachedResultName": "n8n"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b60a4c7a-c98a-49ea-9fda-d231405f66e0",
      "name": "Receive Extraction Results",
      "type": "n8n-nodes-base.webhook",
      "notes": "Receives the extracted driver license data from VLM AI when asynchronous processing is completed.",
      "position": [
        1040,
        840
      ],
      "parameters": {
        "path": "extract-us-driver-license",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "d8974c1f-22b8-4191-a4eb-7d1c6de5710c",
      "name": "Save to License Database",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Appends the extracted driver license information to Google Sheets database with structured columns for easy access and reporting.",
      "position": [
        1360,
        840
      ],
      "parameters": {
        "columns": {
          "value": {
            "DOB": "={{ $json.body.response.date_of_birth }}",
            "Name": "={{ $json.body.response.full_name }}",
            "Expiry": "={{ $json.body.response.expiration_date }}",
            "Issue date": "={{ $json.body.response.issue_date }}",
            "License No": "={{ $json.body.response.license_number }}"
          },
          "schema": [
            {
              "id": "License No",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "License No",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DOB",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "DOB",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Issue date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Issue date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Expiry",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Expiry",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OcL9cb79K8rMmlvIeMAXheLmiHaSp_iYQTo6X4RRzII/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OcL9cb79K8rMmlvIeMAXheLmiHaSp_iYQTo6X4RRzII",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OcL9cb79K8rMmlvIeMAXheLmiHaSp_iYQTo6X4RRzII/edit?usp=drivesdk",
          "cachedResultName": "Driver License Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "72a25032-ca93-4d62-9ac7-5833f3c24c5c",
      "name": "Download License",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "Downloads the uploaded driver license image from Google Drive and prepares it for AI-powered data extraction.",
      "position": [
        440,
        840
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    }
  ],
  "connections": {
    "Download License": {
      "main": [
        [
          {
            "node": "VLM Run License Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor License Uploads": {
      "main": [
        [
          {
            "node": "Download License",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Extraction Results": {
      "main": [
        [
          {
            "node": "Save to License Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}