Skip to main content
Roberty Studio
AIRoberty

Run an IDP template

Process a document with one of the workspace's IDP templates from the agent.

Run an IDP template

Lets the agent process a document with one of the workspace's IDP templates. The agent sends the file, waits for the processing and gets the structured result back: identification, extracted text, post-processing outputs and validations.

Configuration​

FieldRequiredWhat it is
IDP templateYesThe IDP template that will process the documents. Each action uses one template; to use several templates, add one action per template
Timeout (ms)NoHow long to wait for the processing, in milliseconds. Default: 300000 (5 minutes). Maximum: 840000 (14 minutes)
info

The template needs an active published version. The agent always uses the version that is active at the time of the call; changes to the template's draft only take effect once published.

Where the file comes from​

The agent can send the template:

  • A file attached in the conversation — the agent uses the name of the file the user sent in the chat.
  • A file sent with an API run — the files sent along with the agent's run.
  • A file from a storage tool — for example, a file fetched with the Download a file action of Google Drive or OneDrive. Both actions need to be configured on the same agent.

PDFs and images (PNG, JPG, JPEG, WEBP, TIFF and BMP) up to 5 MB are accepted.

How it works​

When the agent reaches for this tool:

  1. It finds the file it was given (attachment, run file or storage file).
  2. It sends the file to the configured IDP template, using the active published version.
  3. It waits for the processing, up to the configured timeout.
  4. It receives the result and answers from it.

Each processing shows up in the template's Runs history, on the Production tab, with Webhook as its origin, and counts toward the workspace's IDP usage like any other run.

tip

If the timeout is reached, the processing keeps going in IDP and can be checked in the template's run history.

Input parameters (at run time)​

ParameterWhat it is
File nameThe exact name of the file attached in the conversation, sent with the run or returned by the storage tool
Download URLOnly for storage files: the download URL returned by the Download a file action
File typeOnly for storage files: the MIME type returned by the same action

The agent never picks the template: it is always the one configured on the action.

Response​

FieldWhat it is
Successtrue if the template finished processing, false on an error or a timeout
Request IDThe run's identifier in the template's history
ResultThe template's result (when it succeeded): identification, extracted text, post-processing outputs and validations
ErrorThe error code (when the processing failed or timed out)

If the template's identification step rejects the document, the response is still successful and the result reports the rejection, with no extracted text.

Common errors​

CodeMeaning
FILE_NOT_FOUNDNo file with that name was sent in the conversation or the run
UNSUPPORTED_FILE_EXTENSIONThe file isn't a PDF or an image IDP accepts
FILE_TOO_LARGEThe file is larger than 5 MB
URL_NOT_ALLOWEDThe download URL doesn't come from Google Drive or OneDrive
FILE_DOWNLOAD_FAILEDThe file couldn't be downloaded (for example, the download URL expired)
TEMPLATE_NOT_FOUNDThe configured template no longer exists in this workspace
NO_ACTIVE_VERSIONThe template has no active published version
TIMEOUTThe processing didn't finish within the timeout