The Deployment / Day2 action does sporadically fail for the second Event Broker Subscription as there was no approval policy applied.
Aria Automation 8.x
The deployment lifecycle passed on to the next stage before the approval policy had been applied to the deployment.
Add a sleep interval to the workflow creating the approval policy, after the POST /policy/api/policies API call to ensure the policy has been applied to the deployment.
What is the recommended sleep time, and does increasing it prevent this issue from recurring?
Approval policies are cached per project. When you create a new policy, the cache requires a minimum time-to-live (TTL) of 2 minutes to invalidate and load the updated policy. If requests are submitted before this interval elapses, they do not match the new policy because the cache has not reloaded.
When creating a new approval policy, wait at least 2 minutes for the cache to invalidate and the policy to become active.