Best Practice for Handling Approval Delays in Ansible–ServiceNow Integration?

Hello

We have integrated Ansible with ServiceNow to automate infrastructure provisioning & change requests but one recurring issue is how to handle approval delays gracefully. :slightly_smiling_face: When a playbook triggers a ServiceNow change request that requires managerial / CAB approval; it often stalls the workflow. Right now; we pause the job manually / retry later but that’s not scalable in a busy DevOps pipeline. :innocent:

We are looking for ways to design the workflow to wait intelligently for approval perhaps using polling, webhooks / custom middleware that checks the ticket status & resumes the playbook only when it’s approved. :thinking:Has anyone implemented this with success? :thinking:Ideally; we would like to avoid complex hacks or custom scripts unless absolutely necessary. I have checked RedHat Ansible integration with ServiceNow - ServiceNow Community guide related to this.

This led us to review documentation on ITSM automation & while testing ideas I also came across a guide explaining What is Servicenow, which helped reframe how we think about workflow dependencies. :innocent: If anyone has a reference architecture; example playbook / even tips for timeout handling we would love to learn from your approach.

Thank you !! :slightly_smiling_face:

Hi. Bit of a disclaimer, I have never actually used ServiceNow as part of my job, but I am a maintainer on the ServiceNow collection ATM.

Would you be able to break the process up, for example
Step 1: playbook triggers a ServiceNow change request that requires managerial / CAB approval, then ends
Step 2: Manager/CAB approves, and ServiceNow uses a callback/webhook to trigger the next playbook

Another idea would be to have a job that runs every X minutes, hours, whatever and uses the change_request_info module to check for tickets that have exited the approval stage. Then that job could kick off the next job(s), depending on what tickets are ready