Overview
The Lola Doc Check node performs document validation based on user-defined rules for allowed countries and document types. It is designed to help automate compliance or onboarding workflows where documents must be checked against specific criteria, such as verifying if a submitted passport or ID is valid for a particular country.
Common scenarios:
- Verifying that uploaded identity documents are acceptable for a given country.
- Automating KYC (Know Your Customer) checks in onboarding processes.
- Filtering out invalid or unsupported document submissions before further processing.
Practical example:
A company onboarding users from multiple countries can use this node to ensure only passports or driver licenses from allowed countries are accepted, with optional fuzzy matching to account for minor typos in document type names.
Properties
| Name | Meaning |
|---|---|
| Input Doc Type | Text representing the type of document to validate (e.g., PASSPORT, DRIVER LICENSE). |
| Input Doc Country | The country code of the document being validated (e.g., US, CA, GB). |
| Target Country | The current target country; only validation rules for this country will be applied. |
| Enable Fuzzy Match | Whether to enable fuzzy matching for document type comparison. |
| Fuzzy Treshold | Fuzzy match threshold (between 0 and 1); only used if "Enable Fuzzy Match" is true. Higher values require closer matches. |
| Validation Rules | A collection of rules specifying which countries and document types are allowed. Each rule includes: |
| - Allowed Countries: Comma-separated list of country codes (e.g., US,CA,GB). | |
| - Allowed Document Types: Comma-separated list of document types (e.g., PASSPORT,DRIVER LICENSE). |
Output
The node outputs two branches:
- valid: Items that pass the validation.
- invalid: Items that do not pass the validation.
Each output item contains a json.lola_text_match object with the following structure:
{
"isDocTypeOk": true, // Boolean: Was the document type accepted by the rule?
"isCountryOk": true, // Boolean: Was the country accepted by the rule?
"isDocValid": true, // Boolean: Both country and document type are valid.
"ruleApplied": { ... }, // The rule object that was matched and applied (if any).
"docTypeScores": [ // Array of objects with fuzzy match scores (if applicable).
{
"type": "PASSPORT",
"score": 0.98
}
]
}
If no match is found, docTypeScores may be undefined.
Dependencies
- External library: Uses
fast-fuzzyfor fuzzy string matching. - No external API keys or services required.
Troubleshooting
Common issues:
- Incorrect country or document type format: Ensure country codes and document types are entered in uppercase and separated by commas without extra spaces.
- Fuzzy matching not working as expected: Adjust the "Fuzzy Treshold" value. Lower values allow looser matches; higher values require more exact matches.
- Validation rules not applied: Make sure both "Input Doc Country" and "Target Country" match one of the allowed countries in your rules.
Error messages:
- If required fields are missing or empty, the node may fail to validate items correctly but does not throw explicit errors—check your input data and rules configuration.