Solved
Received share from Files app
The task is not run if files are shared from the com.android.documentsui ("Files") app.
However, the "Share Trigger" dialog box appears beforehand.