# Can I set two queues for a step to use, but only choose the second if none are available in the first?

**URL:** <https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467>\
**Category:** General\
**Created:** [May 3, 2019, 9:01pm UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467 "2019-05-03T21:01:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [May 3, 2019, 9:01pm UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467/1 "2019-05-03T21:01:15Z")

</div>

Can I set two queues for a step to use, but only choose the second if none are available in the first?

---

<div class="post-metadata">

**Author:** ![anon46008679](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@anon46008679](https://forum.buildkite.community/u/anon46008679)\
**Post date:** [May 7, 2019, 4:03am UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467/2 "2019-05-07T04:03:48Z")

</div>

Hi @nathan.pierce! Nope sorry, there’s no way to set two queues for a step, only two queues for an agent. What’s context/story behind you wanting to do that, so we can either see more clearly what we’re missing, or perhaps find another way?

There’s also agent priorities, which you can use to make sure some agents are preferred over others when they’re being assigned, but I’m not sure if it’s suits the problem you’re trying to solve: [https://buildkite.com/docs/agent/v3/prioritization](https://buildkite.com/docs/agent/v3/prioritization)

---

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [May 7, 2019, 12:31pm UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467/3 "2019-05-07T12:31:21Z")

</div>

Sure, so we’re using Anka to handle our mac builder/tester fleet and have a build step that should run on a host with only one buildkite agent so that it can use the full 12 cores it has (it’s a mac mini). Though, if all other 12 core mac minis are in use, we don’t want to block it running on a 6 core host that has two agents running. On the flip side of that, we would want jobs that normally run on the 6 cores hosts to prioritize the 12 core last and use them only when absolutely necessary.

Macs are expensive and running a single buildkite agent just for a single step is a massive waste. I want to assure teams I support with the anka fleet that if they’re not running a ton of 6 core steps, the 12 cores will always pick up the longest and most intense build step and they will then be getting the fastest build times possible.

---

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [July 9, 2019, 1:34pm UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467/4 "2019-07-09T13:34:48Z")

</div>

Should this be a feature request @anon46008679 ?

---

<div class="post-metadata">

**Author:** ![anon46008679](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@anon46008679](https://forum.buildkite.community/u/anon46008679)\
**Post date:** [July 16, 2019, 1:39pm UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-step-to-use-but-only-choose-the-second-if-none-are-available-in-the-first/467/5 "2019-07-16T13:39:57Z")

</div>

@nathan.pierce I can’t think of any combination of queues or priorities that would help you achieve that one. It’s a tricky one 🤔

Posting to #feature-requests with that context, and perhaps a stab at a pipeline.yml that could work for you, would be great!
