# how to put Job into pending state

**URL:** <https://forum.ansible.com/t/how-to-put-job-into-pending-state/36782>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 28, 2022, 1:29pm UTC](https://forum.ansible.com/t/how-to-put-job-into-pending-state/36782 "2022-06-28T13:29:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AWX\_Project2](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@AWX\_Project2](https://forum.ansible.com/u/AWX_Project2)\
**Post date:** [June 28, 2022, 1:29pm UTC](https://forum.ansible.com/t/how-to-put-job-into-pending-state/36782/1 "2022-06-28T13:29:30Z")

</div>

Hi,

I’m tasked to monitor AWX and alert if jobs stay in pending state for long time. Fr this I pursued different AWX APIs without luck. So, posting following questions.

Q1) How can make a job go into pending status?  
Q2) Is there any API to get all jobs in pending state?

Please help!

Thanks in advance,  
AB

---

<div class="post-metadata">

**Author:** ![rake](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rake](https://forum.ansible.com/u/rake)\
**Post date:** [June 28, 2022, 1:35pm UTC](https://forum.ansible.com/t/how-to-put-job-into-pending-state/36782/2 "2022-06-28T13:35:15Z")

</div>

Api/v2/metrics should provide you pending jobs.  
Second if you want to make jobs going into pending Postgres database if it gets filled up jobs will go into pending that means you can make Postgres file system to fill up.  
Other option is deploy awx operator version newer one and awx older version if your deployment is Kubernetes.

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [June 29, 2022, 7:27pm UTC](https://forum.ansible.com/t/how-to-put-job-into-pending-state/36782/3 "2022-06-29T19:27:56Z")

</div>

Hi!

you can get the current # pending jobs by counting the output from /api/v2/jobs?status=pending, or by using the /api/v2/metrics endpoint

You can “keep” the jobs in pending state by disabling all of your instances – this will prevent any pending jobs from turning into running state

AWX Team
