Google has deprecated legacy versions of AutoML services, which directly impacts IDP's core functionality. Additionally, the IDP application was deprecated with Appian 23.2. Customers who wish to use the application will need to refactor plug-ins using AutoML. |
Many organizations manage documents as part of a larger workflow. Intelligent Document Processing (IDP) has been designed in such a way that it's easy to incorporate into larger workflows. You can use IDP in a subprocess to synchronously process one document, asynchronously process one or multiple documents, or asynchronously process a zip file with multiple documents. This page provides guidance for invoking IDP in a subprocess. If you want to use IDP directly in the IDP site, refer to the Intelligent Document Processing User Guide. If you want to invoke IDP from an external system, refer to Using IDP with External Systems.
If you are an Appian developer incorporating IDP into a larger workflow that cannot continue without receiving the document data, then you may invoke IDP to synchronously process one document.
In your parent process model:
DU_DocUnderstanding
to correspond with the IDP output variable. You may name the variable docUnderstanding
.DU Upload Docs for Understanding
process model.documents
input variable.docTypeId
input variable. The document type ID can be found in the dudoctype
table in the database.docUnderstanding
output process variable.
wereInvalidDocsUploaded
to determine whether subsequent nodes should execute.If you are processing a document that could be one of multiple document types, you can use pv!docUnderstanding.doctypeId
to determine the next steps for each document type once the subprocess completes. To retrieve the document data, you can use this expression, which will output the document CDT that corresponds to the document type.
1
2
3
rule!DU_getDataForUnderstandingId(
understandingId: pv!docUnderstanding.understandingId
)
You should receive an output similar to the following:
1
2
3
4
5
6
7
'type!{urn:com:appian:types:DU}DU_Invoice'(
id: 39,
invoiceNumber: "INV-12",
invoiceDate: "Oct 09, 2019",
total: "$17600.00",
supplier: "Acme Corporation"
)
If you want the person who performs the document reconciliation to complete a subsequent task in the parent process, you may use activity-chaining so they are immediately routed to this task.
You may refer to the process model DU Synchronous Parent Process Example
as an example. You can also duplicate the process model and modify it to suit your use case.
If you are an Appian developer incorporating IDP into a larger workflow that can continue without receiving the document data, then you may invoke IDP to asynchronously process the documents.
In your parent process model:
Text
to correspond with the IDP job GUID output variable. You may name the variable jobGuid
.DU Upload Docs for Understanding
process model.documents
input variable OR select the zip document process variable for the zipFile
process variable (if both input variables are populated, only the documents in the ZIP file will be processed).docTypeId
input variable. The document type ID can be found in the dudoctype
table in the database.jobGuid
output process variable.
wereInvalidDocsUploaded
to determine whether subsequent nodes should execute.You can check on the status using the expression below to check on the status of the job.
1
2
3
rule!DU_isJobDoneForJobGuid(
jobGuid: pv!docUnderstanding.jobGuid
)
Once the expression returns true
, you may use the expression below to retrieve the document data.
1
2
3
rule!DU_getDataForJobGuid(
jobGuid: pv!docUnderstanding.jobGuid
)
You should receive a List of Dictionary
similar to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
{
understandingId: 1353,
documentId: 6230,
documentName: "InvoiceINV-12",
docTypeId: 1,
docTypeName: "Invoice",
entityId: 39,
data: {
invoiceNumber: "INV-12",
invoiceDate: "Oct 09, 2019",
total: "$17600.00",
supplier: "Acme Corporation"
}
},
{
understandingId: 1354,
documentId: 6231,
documentName: "Wayne Enterprises Purchase Order",
docTypeId: 2,
docTypeName: "Purchase Order",
entityId: 19,
data: {
poNumber: "6545",
issueDate: "07/19/2018",
purchaser: "Wayne Enterprises",
total: "$1,350.00"
}
}
}
If you want to use this information directly in the process model, you can use the expression above to retrieve the metadata and map to a list of DU_DocumentMetaData
.
You should receive an output similar to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
{
understandingId: 1353,
documentId: 6230,
documentName: "InvoiceINV-12",
docTypeId: 1,
docTypeName: "Invoice",
entityId: 39
},
{
understandingId: 1354,
documentId: 6231,
documentName: "Wayne Enterprises Purchase Order",
docTypeId: 2,
docTypeName: "Purchase Order",
entityId: 19
}
}
And you can use the following expression to map to a list of your document type CDT such as a list of DU_Invoice
.
1
2
3
rule!DU_getDataForJobGuid(
jobGuid: pv!jobGuid
).data
As an example, for invoices, you should receive a list of DU_Invoice
similar to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
{
id: 39,
invoiceNumber: "INV-12",
invoiceDate: "Oct 09, 2019",
total: "$17600.00",
supplier: "Acme Corporation"
},
{
id: 19,
poNumber: "6545",
issueDate: "07/19/2018",
purchaser: "Wayne Enterprises",
total: "$1,350.00"
}
}
The DU Upload Docs for Understanding
was designed to avoid synchronously processing multiple documents to prevent load on the execution engines. If multiple documents or a zip file is passed in as a subprocess input variable and isAsync
is set to false()
or null()
, IDP will still process the documents asynchronously.
You may refer to the process model DU Asynchronous Parent Process Example
as an example. You can also duplicate the process model and modify it to suit your use case.
Using IDP in a Subprocess