According to the documentation below, request payloads to flow action endpoints sent from Shopify should contain a handle field.
However, we observed that some payloads do not contain this field.
I am guessing from the information in topic below, that Shopify workflows store a snapshot of flow actions when the workflow was created, and those snapshots are not updated even when apps deploy changes to flow actions.
It seems like payloads without handle field originate from workflows created quite a while ago, where flow actions did not have the concept of handle yet.
Request
The current documentation reads as the payload always has a handle field, but this is not true.
Because the reproduction conditions are limited, it is difficult to notice before deployment. (Our app actually had a small outage because of this unforeseen behavior. )
Therefore, could you update the documentation making it clear that handle field does not always exist?
Hey @shunten31 - thanks for flagging this, and you’re reading it correctly.
You’re right that handle isn’t guaranteed on every request. When a workflow is first activated, the action’s fields get baked into that workflow, so workflows created before handle existed will keep sending requests without it. The same thing explains the stale runtime_url behaviour you linked: older workflows hold onto the values they were activated with until they’re updated.
A couple of things to explore on your end:
Treat handle as optional, and fall back to action_definition_id to identify the action when handle isn’t in the payload. That keeps you covered for both old and new workflows.
To refresh an affected workflow at the source, the merchant needs to edit and re-publish it (just toggling it off and on won’t do it).
On our side, we’re looking at updating the docs to spell this out: that handle can be absent for older workflows, and that action_definition_id is the fallback identifier.