Automator workflow only works when clicking "step" I am trying to write a workflow that will use Shell to apply SHA256 to cells in an Excel spreadsheet. 

The Workflow (which may be a bit of a hack) is working, but only when I click through it using "Step" - if I try to Run it or Loop it, the output is not the SHA256 hash but the original input.  

Any ideas? As this seems really weird.

EDIT: Thanks to @Graham Miln I eventually got this working in AppleScript alone without Automator.
The behaviour you describe suggests a timing issue. One or more steps are not completing before the next step begins.

Consider combining all the steps into a single AppleScript. You can use the do shell script command in AppleScript to call out to shasum:

-- Get value to hash from clipboard
set myValue to the clipboard

-- Build the command to execute
set hashCommand to "echo -n " &amp; quoted form of (myValue) &amp; " | shasum -a 256"

-- Debug check the command; comment out when it looks good
display dialog hashCommand

-- Execute command and place on clipboard
set myHash to do shell script hashCommand
set the clipboard to myHash


The clipboard is accessible by AppleScript:

display dialog (the clipboard)


As a single AppleScript, you can debug using Applications > Utilities > Script Editor and gain much better insight into what is happening as the script runs.