How to move automatic file according the content?

Nextcloud version : 20.0.2
Operating system and version : debian 10
Apache or nginx version : apache 2.4.38
PHP version : 7.4

hi, what is the best solution to achieve this automatism?
this is what I want to obtain:

  1. scan a document via android phone
  2. upload this pdf document into a specific NC folder
  3. NC analyze it with OCR
  4. NC move it into another specific folder according to content

for now I get correctly the step 1 and 2, but I can not use a OCR to scan these PDF; how can i do the step 3 and 4?
I have tried to use the flow function but it does not allow me to select the movement of files. thx