How to wait until all files are processed at a task for next step?

I believe the cause of this is that your process has a multi-channel output and collect doesn’t know what to do with it. That’s what the error message is saying. You should apply the collect channel operator to each channel and pass it to the next process.