# Branch override in Workflow template

**URL:** <https://forum.ansible.com/t/branch-override-in-workflow-template/43913>\
**Category:** Get Help\
**Tags:** aap, awx\
**Created:** [July 16, 2025, 7:11pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913 "2025-07-16T19:11:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [July 16, 2025, 7:11pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/1 "2025-07-16T19:11:31Z")

</div>

I am working on setting up a workflow template to run multiple templates against new servers.  
However I have a branch that I made new changes to and I wanted use this particular branch when executing the workflow template. However I can’t seem to make it work. Does anyone have the correct process to resolve this?

---

<div class="post-metadata">

**Author:** ![iwt-cmd](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iwt-cmd/32/9120_2.png) [@iwt-cmd](https://forum.ansible.com/u/iwt-cmd)\
**Post date:** [July 17, 2025, 12:44pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/2 "2025-07-17T12:44:17Z")

</div>

Hi @Fracture7144 ,

A couple things to check:

- Any of job templates that are used in the workflow need to have ‘Allow branch override’ enabled on their associated projects
- Set ‘Source control branch’ on the workflow template. This will cascade down to any of the job templates during the workflow run  
 ![image](https://us1.discourse-cdn.com/ansible/original/2X/3/3fdee734c768107fa6bc4eff034525f9b20dd0b0.png)  
 ![image](https://us1.discourse-cdn.com/ansible/original/2X/9/9fc99d270163dec5fdb39a6f48f007c2e019c6ed.png)

If you only need a couple of the job templates to use a different branch but others in the workflow should use their default, you can set ‘Prompt on launch’ for ‘Source control branch’ on the job template(s). When you add the job template to the workflow, you can then set the branch as needed.

The best approach will depend on how you have your projects/job templates structured.

Best regards,

Joe

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [July 17, 2025, 1:58pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/3 "2025-07-17T13:58:13Z")

</div>

This did not work for me. I have cloned my project and forced it to use my specified branch. I then went to the template I created for and specified the scm branch to use in there. I then went to the workflow template and removed any specified scm branch and the prompt on launch. I then saved and ran it. It STILL failed. It ran the main branch still.

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

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

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

---

<div class="post-metadata">

**Author:** ![iwt-cmd](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iwt-cmd/32/9120_2.png) [@iwt-cmd](https://forum.ansible.com/u/iwt-cmd)\
**Post date:** [July 17, 2025, 4:50pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/4 "2025-07-17T16:50:55Z")

</div>

Interesting, do the commit IDs on the project and branch in SCM match?

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [July 17, 2025, 4:52pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/5 "2025-07-17T16:52:11Z")

</div>

Yes. I am actively working with support on this. But not moving super quickly.

---

<div class="post-metadata">

**Author:** ![Alexon1999](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/alexon1999/32/9649_2.png) [@Alexon1999](https://forum.ansible.com/u/Alexon1999)\
**Post date:** [October 14, 2025, 2:14pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/6 "2025-10-14T14:14:32Z")

</div>

@Fracture7144

I have the same problem as you, have you found a solution?

i did this Configuration AAP level to be able to perform this override at launch:

In Project

- Enter the source control URL
- Leave the Branch and refspec fields blank
- In the options, only check the “Update Revision at Launch” and “Allow Branch Override” boxes. Disable the other options.

In Inventory

- Enter the path to the inventory file
- Leave the Branch fields blank
- Choose the project created just before
- In the options, only check the “Clean”, “Delete”, and “Update at Launch” boxes. Disable the other options.

In Job Template

- Check the “Ask me at Launch” box for the branch to be overridden
- Check the “Ask me at Launch” box for the inventory to be taken into account

Same problem here

---

<div class="post-metadata">

**Author:** ![Fracture7144](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fracture7144](https://forum.ansible.com/u/Fracture7144)\
**Post date:** [October 14, 2025, 2:56pm UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/7 "2025-10-14T14:56:51Z")

</div>

Thanks for the reply. I got this resolved with support.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [October 15, 2025, 12:16am UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/8 "2025-10-15T00:16:53Z")

</div>

> [@Fracture7144](#):
>
> I then went to the workflow template and removed any specified scm branch

There’s where your problems started. You can’t simply “remove” any specified scm branch through the web GUI! By the way, this works the same surprising way for schedules and their prompts. I just spent the last hour or so verifying that. I’ll explain it in terms of schedule prompts because that’s where my head is at the moment, but it’s the same issue.

Bonus fun: everything I’m about to say about scm branches “works” the same way for limits!

Here’s the setup:

- Create project “xkcd-project” with default scm branch “main”, and “allow branch override” checked.
- Create job template “xkcd-template” with scm branch “mango” + “prompt on launch” checked.
- Create template schedule “xkcd-sched1” and click “[Prompt]”. It opens a dialog with Source Control Branch set to “mango”.

Save the prompt, set the time on the schedule and save that. When it runs it uses branch “mango” — surprising nobody. So far so good.

Now let’s break it!

- Open the schedule, edit the “[Prompt]”, and “clear” the text box for the SCM branch. Save the prompt. Update the schedule to run in a minute and save it.

Q. When the job runs, is it going to use the branch specified in the template (“mango”), or the project default (“main”)?

A. It’s going to use the project default (“main”).

You might expect the SCM branch to revert to the branch (“mango”) from the “next level up” (the job template) if you _don’t specify one_ in the schedule prompt. And in fact you’d be right! But _we did specify a branch_ in the schedule prompt: `""`. An empty string is a value, and it does override the setting from the job template.

If you want a prompted string to be `null` instead of `""`, you can’t do that through the [Prompt] dialog. Instead, you have to use the API, where it’s actually pretty easy. For example, when I navigate to [https://my.awx.instance/api/v2/schedules/629/](https://my.awx.instance/api/v2/schedules/629/) I get the schedule details for my schedule. At the bottom of that page is a form ready to submit (“PUT” or “PATCH”) with the existing values already populating a JSON payload. Among other things, it shows

```
"scm_branch": "",

```

If I change this to

```
"scm_branch": null,

```

and hit “[PUT]”, it changes my prompt’s Source Control Branch from the _empty string_ value – which overrides to template’s scm branch – to _no value_ – which doesn’t override but instead allows the schedule to inherit the template’s scm branch.

All that applies to limits, too. Possibly other stringy things in the web GUI.

As near as I can tell, in AWX (and presumably up until very recent, and maybe current - I wouldn’t know) AAP, once a string in a dialog gets a non-`null` value through the GUI, there’s no way to get it back to `null` without going through the API.

---

<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:** [November 14, 2025, 12:17am UTC](https://forum.ansible.com/t/branch-override-in-workflow-template/43913/9 "2025-11-14T00:17:51Z")

</div>

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