Lola Doc Check
AI-generatedOverview
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 country for which the validation rules should apply; only rules for this country will be used. |
| Enable Fuzzy Match | Whether to enable fuzzy matching for document type comparison. |
| Fuzzy Treshold | The minimum similarity score (0–1) required for a fuzzy match to be considered valid. Only shown if "Enable Fuzzy Match" is true. |
| Validation Rules | A list of rules, each containing: |
| - 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 passed validation.
- invalid: Items that failed validation.
Each output item contains a json.lola_text_match object with the following structure:
{
"isDocTypeOk": true, // Boolean: Was the document type accepted?
"isCountryOk": true, // Boolean: Was the country accepted?
"isDocValid": true, // Boolean: Both country and doc type are valid
"ruleApplied": { ... }, // The rule object that was applied (if any)
"docTypeScores": [ // Array of fuzzy match results (if applicable)
{
"type": "PASSPORT",
"score": 0.98
}
]
}
- If no fuzzy matches are found,
docTypeScoresmay be undefined or an empty array. - No binary data is produced by this node.
Dependencies
- External library: Uses the
fast-fuzzypackage for fuzzy string matching. - No external API keys or services required.
- No special n8n configuration or environment variables needed.
Troubleshooting
Common issues:
- Validation always fails: Ensure that the input values for "Input Doc Type" and "Input Doc Country" exactly match the expected format (case-insensitive, trimmed, correct codes).
- Fuzzy matching not working: Make sure "Enable Fuzzy Match" is enabled and "Fuzzy Treshold" is set appropriately (lower threshold = more lenient).
- No rules applied: Double-check that "Target Country" matches one of the allowed countries in your rules.
Error messages:
- The node does not throw custom error messages but may fail silently if required properties are missing or misconfigured. Always check that all required fields are filled.