Purpose
The Affinda Platform is designed to flexibly integrate into a wide range of document processing workflows. We understand that every customer’s internal systems, validation rules, and exception handling processes are different. This guide outlines a framework to help you choose the most suitable integration workflow that fits your use case. It presents six common integration patterns used by customers today, each representing a distinct way to manage the flow of documents, data, and decisions between your system and Affinda.Workflow criteria
Your solution design will heavily depend on the answer to two key questions.Q1. Will any exceptions be reviewed in Affinda’s UI?
Exception handling requires users to review any documents that fail validation logic and manage the steps needed to correct them. This may occur within Affinda via our validation interface, or entirely within your system using custom workflows or user interfaces.Q2. Will any validation or mapping logic be completed inside Affinda?
Validation logic refers to the business rules used to decide whether the extracted data is complete, correct, or acceptable. This could be implemented by:- Implementing within the Affinda Platform using our validation rule and data mapping capabilities (see our tutorial on Straight-Through Processing for more information)
- By implementing this logic in your system
Workflow Summary Table
Detailed overview
The below provides detailed explanations of each of the workflow options.W1
No validation
W1
No validation

API integration
POST /documentwebhook: document.parse.completedGET /document
W2
Client-side validation
W2
Client-side validation

API integration
POST /documentwebhook: document.parse.completedGET /document
W3
Affinda validation logic
W3
Affinda validation logic

API integration
POST /documentwebhook: document.validate.completedGET /document- Use
GET /allvalidationresultsto get results for each field, else useisConfirmedfrom the document response to determine if the document needs exception handling
- Use
W4
Review all documents in Affinda
W4
Review all documents in Affinda

API integration
POST /documentwebhook: document.validate.completedGET /document
W5
Client-side validation with exception handling in Affinda
W5
Client-side validation with exception handling in Affinda
- Validation logic is already built and they do not want to move this across into the Affinda Platform
- Have a high amount of reference data needed for validation
- They prefer not to build their own correction interface
Updating results in Affinda
The two most common ways to send failed validation results created in your system are:- Field validation results: Add field-level warnings explaining why they have failed validation.
- Warnings: Add a document-level message explaining which fields need attention (see image below).


API integration
POST /documentwebhook: document.parse.completedGET /documentPATCH /document(addwarningMessages) orPOST /validation-results/batch-create-validation-results(see ‘Updating results in Affinda’ above)webhook: document.validate.completedGET /documentPATCH /document(isConfirmedset to true)
W6
Validation logic & exception handling in Affinda
W6
Validation logic & exception handling in Affinda

API integration
POST /documentwebhook: document.validate.completedGET /document
External reference data
Global data
Many teams will have a master list of data that they want to map the extracted data to - this is known as a Data Source in Affinda. This reference data can be added by uploading a flat-file via the platform, or by adding and updating via API. This global reference data is managed separately from the document upload and export flow, and the matching of raw data to reference data occurs within the document processing.Document specific data
Occasionally, teams will need to inject data per document. This may be needed where additional data specific to that document (but not present on the document itself) is needed for validation (e.g., the user submitting the file to the client system specifies the expected value of the document, and this is matched against the extracted data). In this case, customers should patch the data to the document as part of either W3 or W6.FAQs
Is data mapping required in all workflows?
Is data mapping required in all workflows?
Do I need to rerun validation rules after patching a document?
Do I need to rerun validation rules after patching a document?
Can I use multiple workflows in the same integration?
Can I use multiple workflows in the same integration?
