# Run parallel/concurrent jobs of the same template with custom inventory script

**URL:** <https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [October 14, 2022, 3:36pm UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228 "2022-10-14T15:36:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![T\_K\_Sourabh](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@T\_K\_Sourabh](https://forum.ansible.com/u/T_K_Sourabh)\
**Post date:** [October 14, 2022, 3:36pm UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228/1 "2022-10-14T15:36:07Z")

</div>

Hi,

I have been trying to run concurrent jobs in AWX but is currently faced with an issue where if you have “update on launch” set on inventory script, the second and further jobs would be in pending state and would wait for the first job to complete. Inventory is supplied via custom python script which needs to run for each job and hence not static.

I was wondering if there is any we could solve this? Could we supply inventory data as params when invoking api (api/v2/job\_templates/{id}/launch/), well not really, but looking for a solution to parallelize/concurrent the jobs as hosts data is coming to me in a phased manner. I have an intermediate code/cron job to batch the hosts and invoke awx API after a certain timeout.

Open to ideas.  
Thanks  
TKS

---

<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:** [October 14, 2022, 5:09pm UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228/2 "2022-10-14T17:09:41Z")

</div>

Hi TKS,

Did you enable concurrent jobs checkbox in the job template? If you queue up 10 jobs all based on the same inventory, they all enter pending at the same time. The task manager will start an inventory update (since your update on launch is set to True). All 10 pending jobs will wait on that inventory update to finish running. Then, if concurrent is enabled for your JT, then all 10 will enter a running state.

I may be missing a detail, but that is the intended behavior.

AWX Team

---

<div class="post-metadata">

**Author:** ![T\_K\_Sourabh](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@T\_K\_Sourabh](https://forum.ansible.com/u/T_K_Sourabh)\
**Post date:** [October 14, 2022, 5:41pm UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228/3 "2022-10-14T17:41:36Z")

</div>

Yes, the concurrent checkbox is enabled.

This is a bit old service:  
Awx version:7.0.0  
Ansible version: 2.8.4

Is the mentioned behaviour applicable for this version of awx? Does cache timeout value have any impact?

---

<div class="post-metadata">

**Author:** ![T\_K\_Sourabh](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@T\_K\_Sourabh](https://forum.ansible.com/u/T_K_Sourabh)\
**Post date:** [October 17, 2022, 11:01am UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228/4 "2022-10-17T11:01:01Z")

</div>

Hi,  
Any update on this?

---

<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:** [October 17, 2022, 1:58pm UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228/5 "2022-10-17T13:58:50Z")

</div>

the behavior I described is for later versions of AWX. I’m not sure what the expectation is for v7.0 is, as that version is no longer supported.

We highly recommend upgrading to the latest version of AWX if possible. I suspect you won’t have this issue on new versions.

AWX Team

---

<div class="post-metadata">

**Author:** ![T\_K\_Sourabh](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@T\_K\_Sourabh](https://forum.ansible.com/u/T_K_Sourabh)\
**Post date:** [October 17, 2022, 2:59pm UTC](https://forum.ansible.com/t/run-parallel-concurrent-jobs-of-the-same-template-with-custom-inventory-script/37228/6 "2022-10-17T14:59:49Z")

</div>

Is there a way we can pass in the inventory file for the jobs via API call?
