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?
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
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
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.
Interesting, do the commit IDs on the project and branch in SCM match?
Yes. I am actively working with support on this. But not moving super quickly.
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
Thanks for the reply. I got this resolved with support.
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/ 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.




