Exception: Unknown 'Run Code' execution error

A flow that has been working fine for months has suddenly started failing with “Exception: Unknown ‘Run Code’ execution error”. If I test it on existing orders that previously worked, it still errors. Shopify provides no logs, so it’s impossible to determine the cause of the issue.

I’ve tried replacing the code with dummy code that does nothing and it still seems to trigger the same error so the problem is almost certain on Shopify’s side.

Yeah, if even dummy code is throwing that generic exception, the Flow execution sandbox is definitely choking on Shopify’s end. I ran into a similar weird glitch with the Run Code action a few weeks ago.

Two things you can try before dealing with support:

  1. Duplicate the entire flow and test the copy.
  2. Delete the Run Code block completely and add a fresh one in. Sometimes the specific node gets corrupted behind the scenes.

If it still fails, you’ll unfortunately have to escalate to Shopify Support. Tell them to flag it directly to the Flow team since you’ve already isolated it to the sandbox failing on empty code.

This is almost certainly a Shopify-side issue, the fact that even dummy code throws the same error is the giveaway, it’s not your logic at all.

A few things worth trying while you wait for them to fix it:

  • Duplicate the Flow and run it fresh; sometimes a new instance clears whatever got corrupted on the backend

  • Remove and re-add the “Run Code” action entirely in the duplicated flow

  • Check Shopify Status page at shopify.com/status to see if Flows/Run Code is flagged

Most importantly raise it directly with Shopify Support and include the Flow name, affected order IDs and the exact error, the more examples you give them the faster they escalate it.

You’re not doing anything wrong here, just needs to be on their radar!

This sounds genuinely frustrating, especially without any logs to debug. Based on what you’re describing—dummy code still failing and previously working orders now throwing errors—it does seem like a platform-side issue rather than a problem with your code logic.

A few things you can try:

Immediate steps:

  • Deactivate and then reactivate the workflow. This can sometimes reset the execution environment for the “Run Code” action.

  • Duplicate the workflow and test the duplicate. A fresh workflow instance can occasionally bypass any corrupted state causing the issue.