From this article you will learn:
- What is the Document Sorting extension
- How to set up Document Sorting extension
- How to test and tweak Document Sorting extension
What is the Document Sorting extension
When you receive different types of documents in your Rossum inbox, you may need to sort them into different queues based on their type ( such as an invoice, credit note, or purchase order)
Why is this the case?
- You may need to extract different fields for each document type.
- You may have different people processing them.
- There may be another end system to export them to.
- You may have an additional validation or approval process.
- You name it.
To help you solve this problem, we have prepared a simple but powerful feature you can download from our Rossum Store – Document Sorting extension.
How to set up a Document Sorting extension
Setting it up takes a few simple steps. Once you do it, it will automatically sort all new incoming documents. You can also get sorted the documents already in the queue before activating this extension. However, to do that, you need to reset (re-extract) those documents.
Step 1: Prepare your queues and schemas
To prepare your queues and schemas for Document Sorting, you need these three things:
- One queue in which you receive all the documents.
- As many other queues as many document types you receive or wish to distinguish and sort.
- Ensure that your queues have a “Document type” field active in their schema so Rossum can extract it for you.
It is a good idea to name your “receive queue” something like “Incoming Documents,” “Sorting queue,” or something similar. For the other ones, it probably makes sense to call them according to the Document Type, such as “Invoices,” “Receipts,” etc.

It is necessary to check whether your schema contains the Document Type extraction field. It doesn’t need to be visible on the validation UI if you don’t want it (unchecked box), but it needs to be in the schema.

This field is available by default on all new queues. So if you are missing it in your queue schema, create a new queue and copy it from there. You can also copy the code below to your schema:
{
"rir_field_names": [
"document_type"
],
"constraints": {
"required": false
},
"default_value": null,
"category": "datapoint",
"id": "document_type",
"label": "Document Type",
"hidden": true,
"type": "enum",
"can_export": false,
"options": [
{
"value": "tax_invoice",
"label": "Tax Invoice"
},
{
"value": "credit_note",
"label": "Credit Note"
},
{
"value": "proforma",
"label": "Pro Forma Invoice"
},
{
"value": "debit_note",
"label": "Debit Note"
},
{
"value": "receipt",
"label": "Receipt"
},
{
"value": "other",
"label": "Other"
}
]
},

Step 2: Activate Document Sorting in Rossum Store
To activate Document Sorting, go to the Rossum application and:
- Click on the Extensions tab at the top of the app.
- Click on the Rossum store option to display all the available extensions.
- Select the “Document Sorting” extension tile.
- Click “Try extension.”

Step 3: Specify to which queue(s) you want to add this extension.
Once you are in the “Rossum Store Extension Settings,” scroll down to “Queues” and select the queue(s) in which you want to use the extension. Please remember to save your changes once you’ve chosen the desired queues.

Step 4: Set up the sorting rules
The last step is to set up the sorting rules – that is, what document type should go to which queue. Stay on the “Rossum Store extensions settings” screen and scroll down to “Configuration.” where you will see a JSON code containing “rules.”
- "value": "tax_invoice" – the value expected here is the document type you want to sort. It needs to be in the form of a field ID found in your extraction schema.
- "schema_id": "document_type" – you shouldn’t change this value. It means sorting based on the document type.
- "target_queue": 100001 – this is the most important thing you must edit. Add the ID of the queue where you want to send documents, such as “Invoices.” Otherwise, they won’t get sorted.
- "target_status": "importing" – no need to edit this. It says what will be the status of the document after the sorting. “Importing” status ensures that your document is extracted and validated in the destination queue using the fields of that queue.
- "trigger_status": "to_review" – no need to alter this. It says in what status we want the documents to get sorted when they are still in our “Incoming Documents” queue. Typically you want to get them sorted right after they are received. If your workflow is different i.e., you first extract and validate them in the Incoming Documents queue, and they should get sorted after confirming, you may change it easily.
- "recompute": true – If this option is enabled (set to true) and the `target_status` is importing, the document will be processed again using the AI engine in the target queue. It helps create a triage mechanism where an engine in one queue serves as a classifier. The documents are then routed to different queues to be processed by specific engines.

Where to find the queue ID
To find your queue ID:
- Go to Documents
- Click the queue to which you want to sort (such as invoices)
- Click the URL bar
- Copy the number after “annotations”

How to test and tweak Document Sorting extension
To try out the extension, send a document to your “Incoming Documents” queue and see it get sorted.
Cool, right?
We want our functions in Rossum Store to help you solve your business challenges and inspire you to create your extensions! That’s why we allow you to view their code and copy it to your function.

To copy the entire behavior in your custom function, either access the function via API to see the setup or read here what else will be needed:
- In triggered events, check the “Document status – changed”.
- In Access to Rossum’s API from the extension under “Advanced settings”, choose your name (an Admin account).
