In my case I had to go:
Settings & Privacy > Privacy > Full Disk Access (in the left hand panel) and add Automator
I had also tried adding Automator to Accessibility as other answers suggested (which didn't initially work for me) so perhaps we need to add Automator in both places.