Actions not waiting for previous action to complete.

I have a simple rule that runs a shell script and marks the file with a red tag.
I expected that the shell script would need to run successfully before marking the file with the red tag. What I see as I watch the directory with all the files to be processed is that all the files receive the red tag long before the shell script has run.
Why?
I would have a lot more confidence in the process, if the red tag did not get set until after the shell script had successfully completed. Now my only check is to count the files in the source directory vs the destination directory to make sure that match.
I expected that the shell script would need to run successfully before marking the file with the red tag. What I see as I watch the directory with all the files to be processed is that all the files receive the red tag long before the shell script has run.
Why?
I would have a lot more confidence in the process, if the red tag did not get set until after the shell script had successfully completed. Now my only check is to count the files in the source directory vs the destination directory to make sure that match.