Unable to run Scriptable script via Automation

I have a Scriptable script + a Shortcut which calls this script using x-callback URL scheme. The shortcut runs fine without any issues but when it is run through automation it gives below error.

Has anybody faced this issue?

Do you have to confirm the execution of the automation? If no, then I think that that’s the problem.

I haven’t tested it, but I think that an unconfirmed automation can’t open anything. But I’ve also read that people have made an automation that opens app X when app X is closed and it worked without confirmation (it essentially trapped them in the app, so don’t try it).

Another workaround is to run the script inline in shortcuts. Or use a Scriptable action and enable Run in App. But then you would have to open shortcuts yourself from the script.

I do not get a confirmation for running the automation. I just get this error. I am on iOS 14.4 Beta 1 so that could be an issue. Could you tell me what do you mean by unconfirmed automation?

I will check the other options that you have mentioned. Thanks for taking out the time to reply.

With the confirmation I meant the Ask when run toggle in the automation edit screen. Sorry that I didn’t specify it correctly. I think that the automation may have more restrictions when this toggle is off, but I can also be wrong.