# AWX : Select Instance group Workflow template

**URL:** <https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [June 6, 2024, 3:52pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222 "2024-06-06T15:52:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![prateektl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prateektl/32/8985_2.png) [@prateektl](https://forum.ansible.com/u/prateektl)\
**Post date:** [June 6, 2024, 3:52pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/1 "2024-06-06T15:52:14Z")

</div>

How can we select the instance group while triggering the workflow template. We have the option to select the inventory, but we have a requirement to select the instance group while executing workflow template.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [June 6, 2024, 4:19pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/2 "2024-06-06T16:19:39Z")

</div>

You can define this in Job Templates, and can check the box to “Prompt on Launch” for them.

In _Workflow_ Templates, it doesn’t prompt for this at the workflow level, but you can answer the Instance Group for each Job Template node in the Workflow that prompts for it. This would be a static configuration, so you can’t prompt for it at the workflow’s runtime, but I don’t exactly know why you would _want_ to either.

---

<div class="post-metadata">

**Author:** ![sirjaren](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sirjaren](https://forum.ansible.com/u/sirjaren)\
**Post date:** [June 6, 2024, 5:10pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/3 "2024-06-06T17:10:43Z")

</div>

> [@Denney-tech](#):
>
> I don’t exactly know why you would _want_ to either

At first glance it does appear to be a unique requirement but as an example, I could see remote execution nodes which are intended for jobs/work on other specific servers/appliances.

For instance, you may have some job templates which operate on specific network appliances/devices and have that access gated by some subnet/firewall where said action can be performed. In this case, one or more execution nodes running in that subnet can be bastion nodes to perform that work and can be used in the job template and called via the OP’s workflow.

Maybe not the best example but it’s really the only thing I could think which would make sense.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [June 6, 2024, 9:48pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/4 "2024-06-06T21:48:16Z")

</div>

That’s a perfectly reasonable scenario for Instance Groups and having them be dynamically assignable to Job Templates. I still don’t see why a Workflow Template _itself_ should need to. You can place multiple job templates, including multiple occurrences the same one, using various/different instance groups in a workflow.

The same workflow can handle jobs run against Network A, B, and C all at the same time. If you want the workflow to only run against Network A, B, _or_ C, then you would need to limit your inventory to that network. Changing Instance Groups on the fly wouldn’t make sense since there’s a hard dependency on which network works with which Instance Group.

---

<div class="post-metadata">

**Author:** ![prateektl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prateektl/32/8985_2.png) [@prateektl](https://forum.ansible.com/u/prateektl)\
**Post date:** [June 7, 2024, 9:48am UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/5 "2024-06-07T09:48:06Z")

</div>

sirjaren explained the scenario which we have encountered. We have thousands of servers with restrictions on networks. Lets assume we have 2 instance group named IG-A and IG-B and 4 inventories. Here 2 inventories can be executed while selecting IG-A as the instance group and the remaining 2 by selecting IG-B. If its vice versa then the execution fails with connectivity issue. Also our work flow template has 40+ job templates within it. So having a prompt on launch option for selecting the instance group similar to inventory would be helpful to execute the scenario.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [June 7, 2024, 2:11pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/6 "2024-06-07T14:11:35Z")

</div>

Since your workflow is so large, I think the easiest thing for you to do is assign the appropriate Instance Group directly to your inventory. Then you can run your 40+ node Workflow against any inventory you like, and it will use the appropriate pool of execution nodes.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/b/b07c7824bc542d1e657e135651467d97cb99d0b5.png)

---

<div class="post-metadata">

**Author:** ![prateektl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prateektl/32/8985_2.png) [@prateektl](https://forum.ansible.com/u/prateektl)\
**Post date:** [June 7, 2024, 4:00pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/7 "2024-06-07T16:00:45Z")

</div>

Thanks @Denney-tech above suggested method worked. I was able to trigger the entire workflow against the expected instance group.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 7, 2024, 4:01pm UTC](https://forum.ansible.com/t/awx-select-instance-group-workflow-template/6222/8 "2024-07-07T16:01:19Z")

</div>

Closed on July 7, 2024, 4:01pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
