{
  "name": "Extract passport data with OpenAI OCR and generate QR codes",
  "nodes": [
    {
      "id": "ac9f02e6-b5d9-4c92-93e7-818f970ae1fd",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1360,
        368
      ]
    },
    {
      "id": "1da0691b-96a2-447e-9a7f-38c22321c148",
      "name": "Loop Over images",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -832,
        368
      ]
    },
    {
      "id": "5e604ffc-ca95-487e-989c-f7041b5d4dfa",
      "name": "OCR - openAI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        352,
        368
      ]
    },
    {
      "id": "e242bd79-b027-4124-9bd5-4368c2917951",
      "name": "If is image",
      "type": "n8n-nodes-base.if",
      "position": [
        -384,
        384
      ]
    },
    {
      "id": "5591e2c6-8e40-4d6e-b4fb-60c1c52b97d3",
      "name": "If has result",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        368
      ]
    },
    {
      "id": "a0084d12-2a31-4f49-83b7-caf290318d18",
      "name": "Resize Image",
      "type": "n8n-nodes-base.editImage",
      "position": [
        -144,
        368
      ]
    },
    {
      "id": "6d73bc19-9b0c-4ab0-b3e4-e51daa7c91ea",
      "name": "Update imageBase64",
      "type": "n8n-nodes-base.code",
      "position": [
        96,
        368
      ]
    },
    {
      "id": "83acad24-214a-4a8a-894b-5818276dd1e1",
      "name": "Data standardization",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        368
      ]
    },
    {
      "id": "fce4c52a-e6ae-444a-96e6-fd4c2126a14b",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -96,
        -160
      ]
    },
    {
      "id": "5b41a7d1-5710-4539-b422-c1909c4c066c",
      "name": "Form",
      "type": "n8n-nodes-base.form",
      "position": [
        -96,
        16
      ]
    },
    {
      "id": "3c7b8c9b-a7a4-493a-a787-99d5c2b974be",
      "name": "Grab image",
      "type": "n8n-nodes-base.code",
      "position": [
        -352,
        16
      ]
    },
    {
      "id": "416bc7b1-dca0-4c22-87b0-18d718037aa1",
      "name": "Prepare form",
      "type": "n8n-nodes-base.code",
      "position": [
        -1104,
        368
      ]
    },
    {
      "id": "29151a3e-aa10-4ef7-8208-6d38e9e2f215",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -272
      ],
      "parameters": {
        "width": 688,
        "height": 448,
        "content": "## Result aggregation\nCombine extracted data and QR codes, then deliver via form completion page and email"
      }
    },
    {
      "id": "6ddf5763-45d9-4df5-bce3-017087435fbe",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        240
      ],
      "parameters": {
        "width": 688,
        "height": 368,
        "content": "## Image preprocessing\nValidate image files, resize for optimal OCR accuracy, prepare for data extraction"
      }
    },
    {
      "id": "28ff2de8-af39-42cb-8f44-ae6a0842d25f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        240
      ],
      "parameters": {
        "width": 784,
        "height": 368,
        "content": "## Form input processing\nReceive multiple image uploads from form, split into individual items for sequential processing"
      }
    },
    {
      "id": "60da4d75-335a-4375-81d2-80367b48eea4",
      "name": "Prepare QR url",
      "type": "n8n-nodes-base.code",
      "position": [
        944,
        352
      ]
    },
    {
      "id": "8f5268aa-e47d-41dc-882f-8b463db889ad",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        -448
      ],
      "parameters": {
        "width": 784,
        "height": 640,
        "content": "## Overview\nThis workflow extracts structured passport data using OpenAI OCR and generates QR codes from the extracted information.\n\n### How it works\n1. User submits passport images via form\n2. Each i"
      }
    },
    {
      "id": "1dc541d7-61ff-4d10-8193-88debac5970c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        672
      ],
      "parameters": {
        "width": 432,
        "height": 96,
        "content": "⚠️ Privacy: Personal identity data. Limit access and configure email carefully."
      }
    },
    {
      "id": "53dbf4e2-d28f-457d-a70e-876c5fe7bb3b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        240
      ],
      "parameters": {
        "width": 608,
        "height": 368,
        "content": "## Data extraction and QR generation\nSend images to OpenAI OCR, standardize extracted fields, validate results, create QR codes"
      }
    }
  ],
  "connections": {
    "Grab image": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If is image": {
      "main": [
        [
          {
            "node": "Resize Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OCR - openAI": {
      "main": [
        [
          {
            "node": "Data standardization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare form": {
      "main": [
        [
          {
            "node": "Loop Over images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Resize Image": {
      "main": [
        [
          {
            "node": "Update imageBase64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If has result": {
      "main": [
        [
          {
            "node": "Prepare QR url",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare QR url": {
      "main": [
        [
          {
            "node": "Loop Over images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over images": {
      "main": [
        [
          {
            "node": "Grab image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If is image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Prepare form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update imageBase64": {
      "main": [
        [
          {
            "node": "OCR - openAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data standardization": {
      "main": [
        [
          {
            "node": "If has result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}