Business Card Reader Workflow
Overview
This page describes how to configure a Business Card Scanner workflow using Document AI, including routing, extraction instructions, Data Board insertion, validation, and fallback handling.
Workflow
Purpose
Accept a card image from a web widget.
Extract contact fields using Document AI.
Optionally insert results into a Data Board.
Normalize output and respond consistently.
Show a retry message when extraction fails.
Routing
File uploaded → Document AI → Post-process → AI Assistant
No file → Text-only handling → AI Assistant
Document AI failure → Message to user
Procedure
1. Web Widget Starter
Configuration
Webhook method
POST
URL mode
Use Test URL for development, Production URL for live
Display the Webhook URLs
ON
Allow Re-trigger After Workflow Ended
ON
Expected input
The widget event should provide:
Card image (preferred as a downloadable URL)
Optional:
textinput (only if you support a help/chat mode)
2. Routing (IF)
Objective
Route the workflow based on whether the incoming payload contains a valid file reference.
Recommended rule
Set the condition so it evaluates to TRUE when a card image exists.
Condition type
Boolean
Operation
Equal
Value 2
true
Value 1
Map to a boolean expression like “file exists / fileUrl not empty”
Route behavior
TRUE: Run Document AI extraction
FALSE: Run text-only handling (Function1 → AI Assistant)
3. Document AI (Business Card Extraction)
Required field mapping
Input File URL
Must be mapped to the uploaded card image URL
If Input File URL is not mapped, the connector will fail and the workflow will proceed via the Fallback path.
Output language
Set Preferred Language Output based on your primary use case (example: English).
Insert to Data Board (optional)
If you want each scan stored:
Enable Insert To Databoard
Select a dedicated board (example:
OCR Scan Business Cards)
Keep business cards in a separate board from invoices/receipts to avoid schema drift.
Extraction instructions (Business Card prompt)
Use a card-specific schema prompt. Avoid multi-document prompts (invoice/receipt/credit-card) in a Business Card Scanner workflow.
Custom AI Instructions (paste-ready):
4. Document AI advanced settings
Recommended defaults (Business Cards)
Time offset
UTC
Request Timeout
60–180 seconds (increase only if needed)
Max Concurrent Requests
2–3
Retry Failed Requests
ON
Max Retries
2
5. Fallback message (Send a Message)
When it triggers
Use this path when Document AI fails (timeout, unsupported input, inaccessible URL, OCR failure).
Recommended message
Replace generic retry text with actionable guidance:
Message (recommended):
“Unable to read the business card. Please retake the photo with good lighting, no glare, and the full card in frame.”
6. Text-only handling (Function1)
Purpose
Only used when no file is uploaded. Converts user text into a prompt for the assistant.
Output contract
Return:
prompt(string)
Recommended usage
Help mode (“How to scan?”, “What fields are supported?”)
Troubleshooting tips when the user doesn’t upload a file
7. Post-processing (Function)
Purpose
Normalize and clean the Document AI output before passing it forward.
Required behavior
Remove empty values:
"",null,undefined, empty arraysEnsure stable types:
emailsmust remain an arrayphonesmust remain an array
Keep only business card fields (avoid filtering rules from other workflows)
Recommended output
Pass a cleaned JSON object downstream (either as:
data(preferred), orpromptcontaining stringified JSON if your assistant requires it)
8. Manage AI Assistants (Normalization + schema enforcement)
Purpose
Final pass to enforce output consistency (schema, dedupe, validation flags if required).
Recommended configuration
Select the assistant dedicated to OCR normalization (example:
OCR & Data Extraction)Enable Customized Prompt
Customized Prompt (paste-ready)
9. Data Board schema (recommended)
If inserting to a Data Board, align columns to the extraction schema:
Core
Full Name
First Name
Last Name
Job Title
Company
Contact
Emails
Phones
Website
LinkedIn
Other Social
Additional
Address
Notes
Operational
Scan Timestamp
Source
Raw Extraction JSON (optional, recommended)
10. Validation rules (recommended)
Mark scan results as “needs review” when:
emails[]is empty andphones[]is emptyfull_nameis empty andcompanyis empty
Suggested validation_flags values:
missing_email_and_phonemissing_name_and_companylow_confidence(if you add confidence scoring later)
11. Testing checklist
Test against:
Horizontal + vertical cards
Low-contrast designs
Two-sided cards (if supported)
Multiple emails/phones
Non-English text (if supported)
Verify:
Input File URL mapping works reliably
Fallback path returns user guidance
Output JSON matches schema every time
Data Board insertion creates records correctly
Last updated