Unstract
The Unstract API connector sends a document to an Unstract API deployment you've built, and returns the fields it extracts, such as an invoice's vendor, number and line items. Mention it as @unstract. The extraction rules live in your Unstract project; the workflow decides what happens with the result.
Connect
In Unstract, deploy your Prompt Studio project as an API. The Unstract documentation covers it. Then:
- Create the credential with the deployment's API Key.
- In the instance's settings, set API Base URL to the deployment's address, such as
https://us-central.unstract.com/deployment/api/<deployment-id>/.
Connectors, instances and credentials covers the rest of the setup. To use two deployments, such as one for invoices and one for receipts, add an instance for each.
| Setting | Default | What it does |
|---|---|---|
| API Base URL | None, required | The deployment's API address. |
| Max Polling Time | 3,600 seconds | How long a step waits for the extraction, from 30 to 3,600. A step whose extraction is still running when the time is up fails, but the extraction still finishes in your Unstract account, so running the workflow again extracts the document twice. An update to Flow restarts the workers that run steps, and a step still running about 17 minutes after the restart begins is stopped and fails. Flow doesn't start it again, because the extraction it sent may still finish in your Unstract account. A fraction is rounded down: 2.5 counts as 2. |
| Polling Interval | 2 seconds | How often it checks, from 1 to 10. A fraction is rounded down: 2.5 counts as 2. |
What a step can do
| Action | What it does |
|---|---|
process_document | Extracts structured data from a PDF, Word, Excel, CSV or image file in the run, and returns the fields your deployment defines. |
split_document | Splits one PDF that holds several documents into one PDF each, with Unstract's document splitter. Its instance's API Base URL must point at the Unstract API hub, with the hub's API Key. |
Send the attachment to @unstract and read
vendor_name,invoice_numberandtotalfrom the result.
Name the fields as your deployment returns them. The extraction uses AI in Unstract each time a run calls it.