ID OCR Verification
The ID OCR Node extracts data from identity documents using Optical Character Recognition (OCR) technology. This node processes front and back images of identity documents and extracts structured data that can be used throughout your conversational flow.
Overview
The ID OCR Node is designed to extract information from identity documents (such as national IDs, driver's licenses, or passports) by processing document images. It supports multiple countries and OCR providers, allowing you to configure the appropriate service for your region and requirements.
This node is essential for onboarding flows where you need to collect and verify identity information from users. It can extract data like names, identification numbers, dates of birth, addresses, and other document-specific fields.
Configuration
Configuration Options
| Option | Description | Type | Required | Default |
|---|---|---|---|---|
| Select Country | The country for which the identity document is issued | Dropdown (Country selection) | Yes | - |
| Provider | The OCR provider service to use for processing | Dropdown (Provider selection) | Yes | - |
| Front Image Variable | Variable containing the URL of the front image of the document | Variable selector (attachment type) | Yes | - |
| Back Image Variable | Variable containing the URL of the back image of the document | Variable selector (attachment type) | Yes | - |
| Store Response in Variable | Whether to save the OCR response data in a flow variable | Toggle switch | No | Off |
| Response Variable | Variable name where the OCR response will be stored (shown when toggle is enabled) | Variable selector (object type) | No | - |
| Store in Package | Whether to save the OCR response as a package for later access | Toggle switch | No | Off |
| Save Images to Identity | Whether to attach the document images to an identity for storage | Toggle switch (Advanced tab) | No | Off |
| Maximum Retries | Number of retry attempts if the OCR provider fails | Number input (Advanced tab) | No | 3 |
Configuration Interface
The node configuration is done through a visual dialog with two tabs:
Configuration Tab
-
OCR Verification Required - A highlighted section explaining that this node extracts data from identity documents using OCR technology.
-
Provider Configuration:
- Select Country - A dropdown to choose the country for which the identity document is issued (e.g., Ecuador)
- Provider - A dropdown to select the OCR provider service (e.g., Nubarium)
-
Front Image Variable - A variable selector to choose the variable containing the URL of the front image of the document. The variable type should be
attachment(e.g.,cedula_front). -
Back Image Variable - A variable selector to choose the variable containing the URL of the back image of the document. The variable type should be
attachment(e.g.,cedula_back). -
Store Response in Variable - A toggle switch to enable saving the OCR response data in a flow variable. When enabled, you can select the variable name (e.g.,
ocr_responseof typeobject). -
Store in Package - A toggle switch to enable saving the OCR response as a package for later access.
Advanced Tab
-
Save Images to Identity - A toggle switch to attach the document images to an identity for storage.
-
Maximum Retries - A number input field to set the number of retry attempts if the OCR provider fails. Range: 1-5, Default: 3.
Input
The node requires two image inputs:
Front Image Variable
The variable containing the URL of the front image of the identity document. This should be an attachment variable that references the document's front side image.
Variable Type: attachment
Example:
Back Image Variable
The variable containing the URL of the back image of the identity document. This should be an attachment variable that references the document's back side image.
Variable Type: attachment
Example:
Output
The node produces structured data extracted from the identity document. The output format depends on the country and document type, but typically includes:
- Personal information (name, identification number, date of birth)
- Address information
- Document metadata (issue date, expiration date, document number)
- Additional fields specific to the document type
Output Format
When "Store Response in Variable" is enabled, the response is stored in the specified variable as an object containing:
- extractedData - An object with the extracted information:
- Personal information (name, identification number, date of birth)
- Address information (street, city, country)
- Other document-specific fields
- documentType - The type of document processed (e.g., "national_id", "cedula")
- confidence - A confidence score (0-1) indicating the accuracy of the extraction
- processedAt - Timestamp of when the processing occurred
Behavior
OCR Processing
- The node receives front and back image URLs from the specified variables
- It sends the images to the configured OCR provider for the selected country
- The provider processes the images and extracts structured data
- The extracted data is returned and optionally stored in a variable and/or package
Retry Logic
If the OCR provider fails, the node will retry the request up to the specified maximumRetries number (default: 3, range: 1-5). This helps handle temporary network issues or provider unavailability.
Package Storage
When storeInPackage is enabled, the OCR response is saved as a package in the system. This allows the data to be accessed later in the flow or in other workflows, and provides a historical record of the extracted information.
Identity Storage
When saveImagesToIdentity is enabled, the document images are attached to an identity record for permanent storage. This is useful for compliance and audit purposes.
Usage Examples
Example 1: Basic OCR Extraction
Configure the node to extract data and store the response in a variable:
- Select the country (e.g., Ecuador) and provider (e.g., Nubarium)
- Select the front image variable (e.g.,
cedula_front) - Select the back image variable (e.g.,
cedula_back) - Enable "Store Response in Variable" toggle
- Select the response variable (e.g.,
ocr_response)
Example 2: Full Configuration with Package Storage
Configure the node with all storage options enabled:
- Select country and provider
- Select front and back image variables
- Enable "Store Response in Variable" and select the variable
- Enable "Store in Package" toggle
- Switch to the "Advanced" tab
- Enable "Save Images to Identity" toggle
- Set "Maximum Retries" to 5
Example 3: Minimal Configuration
Configure the node for basic extraction without storing results:
- Select country and provider
- Select front and back image variables
- Leave all storage toggles disabled
- Optionally adjust "Maximum Retries" in the Advanced tab if needed
Flow Integration
Typical Flow Pattern
-
Before ID OCR Node:
- User uploads document images (via file upload node or message attachment)
- Images are stored in flow variables (e.g.,
cedula_front,cedula_back)
-
ID OCR Node:
- Processes the images and extracts data
- Stores results in specified variables/packages
-
After ID OCR Node:
- Data validation node (to verify extracted information)
- Identity creation/update node (to store identity information)
- Conditional logic nodes (to route based on extracted data)
- Data enrichment nodes (to cross-reference with other sources)
Connecting Nodes
The ID OCR Node typically connects to:
- Input: File upload nodes, message attachment handlers, or image collection nodes
- Output: Data validation nodes, identity management nodes, conditional routing nodes, or data enrichment nodes
Response Samples
The structure of the OCR response varies by country and provider. Below are sample responses for different country and provider combinations.
Ecuador - Nubarium
When processing Ecuadorian identity documents (cédula) with Nubarium, the response includes personal information, document details, and metadata. The response structure varies depending on the document version.
Response Fields
Common Fields (both versions):
- status - Processing status (e.g., "OK")
- validationCode - Unique validation code for this processing
- messageCode - Message code indicating the result
- documentIdentifier - Identifier for the document type and version (e.g., "ECU_IdCard_2009" or "ECU_IdCard_2021")
- className - Document class (e.g., "IdCard")
- subclassName - Document subclass/version (e.g., "2009" or "2021")
- documentType - Type of document (e.g., "ID_CARD")
- country - Country code (e.g., "ECU")
Data Fields - 2009 Version:
- Personal Information: firstName, lastName, identificationNumber, dateBirth, placeBirth, nationality, gender, maritalStatus
- Family Information: fatherName, motherName, partnerName
- Additional Details: educationLevel, occupation, fingerprintId, barcode
- Document Details: issueDate, issuePlace, expiryDate
Data Fields - 2021 Version:
- Personal Information: firstName, lastName, identificationNumber, dateBirth, placeBirth, nationality, gender, maritalStatus, citizenshipStatus
- Family Information: fatherName, motherName, partnerName
- Additional Details: documentNumber, state, barcode, fingerprintId, bloodType, organDonor
- Document Details: issueDate, issuePlace, expiryDate
- MRZ Data: mrz (Machine Readable Zone), mrzValidation (validation results for MRZ fields)
Error Response Fields:
- status - Error status (e.g., "ERROR")
- validationCode - Unique validation code for this processing attempt
- messageCode - Error code indicating the type of error:
- "1" - Document not identified
- "2" - Missing input (e.g., "Document <front> not found" or "Document <back> not found")
- message - Descriptive error message indicating the specific error
Best Practices
- Image Quality: Ensure users upload clear, well-lit images of their documents. Provide guidance on image requirements in your flow.
- Variable Naming: Use descriptive variable names (e.g.,
cedula_frontinstead ofimg1) to make your flows more maintainable. - Package Storage: Enable
storeInPackageif you need to access the OCR data later or for audit purposes. - Retry Configuration: Set
maximumRetriesto 3-5 for production environments to handle temporary provider issues. - Identity Storage: Enable
saveImagesToIdentityfor compliance requirements or when you need to maintain a permanent record of submitted documents. - Data Validation: Validate extracted data before using it in subsequent nodes to ensure data quality.