When receiving various document types in your Rossum inbox, you may have found yourself in need of sorting these incoming documents based on their type (such as an invoice, credit note, purchase order) to different queues.
Why?
- Each document may require a different set of fields to be extracted
- You may have different people processing them
- There may be a different end system to export them to
- You may have a different validation or approval process
- You name it…
To help you solve this need we prepared a simple yet powerful function available in our Rossum Store – Document Sorting.
You can set it up in 3 simple steps:
- Prepare your queues and schemas
- Activate Document Sorting function from Rossum Store
- Set up the sorting rules – from which queue to which queue you want to sort the documents
Once you set it up it will automatically sort all new incoming documents. You can also get sorted the documents which were in the queue already before activating this extension, however you need to reset (re-extract) the documents.
Watch this video guide or read on.
Step 1: Prepare your queues and schemas
In order to prepare your queues and schemas for Document Sorting you need these 3 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.
- Make sure that your queues have a “Document type” field active in their schema so Rossum would 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 (unchecked box) but needs to be in the schema.

This field is available on default on all new queues so if you are missing it in your queue schema, simply create a new queue and copy it from there or copy this code 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 function from Rossum Store
In order to activate Document Sorting function, go to Rossum Store:
- On your Dashboard click the Settings button (the gear icon).
- Then in the left column click “Extensions”.
- In the Rossum Store section you will either already see Document Sorting or click “See all”.
- Click the “Document Sorting” extension tile.
- Click “Try extension”.
- Now on the “Rossum Store extension settings” screen go to “Queues” and select the queue where you receive documents.

Step 3: 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.
For that you will stay on the “Rossum Store extensions settings” screen and scroll down to “Configuration”. You can see here a JSON code containing “rules”.
Let’s break it down line by line:
- “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 just says we are going to sort based on document type (we are working on sorting based on different fields as well – stay tuned!)
- “target_queue”: 100001 – this is the most important thing you need to edit. Input the queue ID of the queue where you want your document sort to, such as “Invoices”. See below where to find it.
- “target_status”: “importing” – don’t need to edit this one. 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 change this one either. 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 immediately after they are received but if your workflow would be different such as you first extract them and validate in the Incoming Documents queue and after confirming they should get sorted, you may change the logic here easily.
Find all your needed document types by value and don’t mind the rest – if you don’t change the queue ID from the sample one to some real one of yours, the documents won’t get sorted.

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

Try it out!
In order to try out the extension, simply send a document to your “Incoming Documents” queue and see it get sorted.
Cool, right?
Tweaking the function
Our functions in Rossum Store are intended not just to help you solve your business challenges but also to inspire you to create your own functions! That’s why we allow you to view their code and copy it to your own function.

In order to copy the full behavior in your own 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 extension under “Advanced settings”, choose your name (an Admin account).
