The next step runs a shell script, "chflags -R nouchg ./"
Sure. That command, as written, will do precisely what you say. There is nothing in the shell command to indicate which folder(s) to work on.
You need to actually pass the folder(s) from the previous step into the shell command.
You need to use the popup menu in the upper-right corner of the run shell command action to change your shell action to take the inputs as arguments rather than the default as stdin. This will essentially rewrite the shell command to loop through the arguments, running the chflags as appropriate:
for f in "$@"
chflags -R nouchg "$f"
but are you saying that all I have to do is change the pulldown to 'arguments' instead of 'stdin' (and I would love to know what stdin is)? Or do I have to change the shell command to your example as well?
You'll have to change the script, too.
The bulk of the re-written script is just a loop that iterates through the items passed in as arguments, running the chflags command for each item (there could be more than one).
As for stdin vs arguments, some shell commands can take their input from the command line and process them - this is what happens, for example, when you pipe some data through grep - the output of one command (stdout) becomes the input data for the next (stdin).
In this case, chflags doesn't care about stdin since it expects all its data to be passed in on the command line, hence the need to pass the data as arguments.
Here is the Automator action you need. It's called "Unlock Finder Items" You can get it from here:
There is a Finder Automator Action pack that you can purchase (really cheap) to get this action and about 20 other awesome actions.
See below service:
I tested it and it works great.