You are helping me build the following AI agent workflow. ## Goal Passport Data Extraction and QR Generation: Submits passport images via form for automated OCR extraction, validation, and QR code generation with results emailed to the recipient. ## Specification - What it does: Submit your passport image via the form to instantly extract personal details, validate them, and generate a secure QR code. You will see the results immediately on the completion page and receive an email confirmation with the generated data. - Trigger: Triggered by an event (Manual ยท on form submission) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - OpenAI: OCR data extraction from images - Gmail: Email delivery of results - HTTP Request: Sending image data to API - Code: Data cleaning and QR generation logic ## Known pitfalls, handle each one explicitly in your implementation 1. OCR accuracy drops significantly on low-light images so add image preprocessing steps like contrast enhancement before sending to OpenAI. 2. Passport MRZ codes have strict checksums so implement a validation function that rejects malformed data before generating the QR code. 3. Gmail API quotas can be exceeded during bulk testing so add error handling to retry failed sends or queue them for later processing. 4. QR codes containing PII must be handled securely so ensure the email transmission uses TLS and avoid storing raw passport images in long-term logs. ## Reference implementation https://n8n.io/workflows/12868 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/passport-data-extraction-and-qr-generation/ via usecasesforagents.com