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
| Field | Required | What it is |
|---|---|---|
| IDP template | Yes | The IDP template that will process the documents. Each action uses one template; to use several templates, add one action per template |
| Timeout (ms) | No | How long to wait for the processing, in milliseconds. Default: 300000 (5 minutes). Maximum: 840000 (14 minutes) |
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:
- It finds the file it was given (attachment, run file or storage file).
- It sends the file to the configured IDP template, using the active published version.
- It waits for the processing, up to the configured timeout.
- 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.
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)
| Parameter | What it is |
|---|---|
| File name | The exact name of the file attached in the conversation, sent with the run or returned by the storage tool |
| Download URL | Only for storage files: the download URL returned by the Download a file action |
| File type | Only 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
| Field | What it is |
|---|---|
| Success | true if the template finished processing, false on an error or a timeout |
| Request ID | The run's identifier in the template's history |
| Result | The template's result (when it succeeded): identification, extracted text, post-processing outputs and validations |
| Error | The 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
| Code | Meaning |
|---|---|
FILE_NOT_FOUND | No file with that name was sent in the conversation or the run |
UNSUPPORTED_FILE_EXTENSION | The file isn't a PDF or an image IDP accepts |
FILE_TOO_LARGE | The file is larger than 5 MB |
URL_NOT_ALLOWED | The download URL doesn't come from Google Drive or OneDrive |
FILE_DOWNLOAD_FAILED | The file couldn't be downloaded (for example, the download URL expired) |
TEMPLATE_NOT_FOUND | The configured template no longer exists in this workspace |
NO_ACTIVE_VERSION | The template has no active published version |
TIMEOUT | The processing didn't finish within the timeout |