Skip to content

Post-consumption scripts

Executed after the consumer has successfully processed a document and has moved it into paperless. — Paperless-ngx documentation


Paperless-ngx supports a single post-consumption script. However, it's perfectly fine to call other scripts from it. This way, you can nicely separate post-consumption scripts for different tasks. Those scripts can also be written in different languages.

Assuming a folder my-post-consumption-scripts/1 with the following structure.

├─ my-post-consumption-scripts/
│    # Sort your scripts into subfolders if you like  ├─ custom-script-01/
│    └─
│  ├─ custom-script-02/
│    └─
│  └─
│  # Obviously the below file only exists  # if you're running Paperless-ngx via Docker Compose
└─ docker-compose.yml

The post-consumption "wrapper" just contains some helper variables and calls to your actual post-consumption scripts.
#!/usr/bin/env bash

# paperless-ngx post-consumption script

SCRIPT_PATH=$(readlink -f "$0")

# Have something written into Paperless-ngx logs
echo "Hello. Post-consumption script here."

bash ${SCRIPT_DIR}/custom-script-01/
python ${SCRIPT_DIR}/custom-script-02/


Have a look at the examples via the navigation on the left side.

  1. That's just an example. It's not strictly necessary to separate pre- and post-consumption scripts. In fact, scripts can be stored everywhere on your system as long as Paperless-ngx is able to access it. But it may help to store your scripts alongside each other.