# Can I set two queues for a pipeline step?

**URL:** <https://forum.buildkite.community/t/can-i-set-two-queues-for-a-pipeline-step/1954>\
**Category:** General\
**Created:** [March 18, 2022, 10:36am UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-pipeline-step/1954 "2022-03-18T10:36:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastianleisinger](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sebastianleisinger](https://forum.buildkite.community/u/sebastianleisinger)\
**Post date:** [March 18, 2022, 10:36am UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-pipeline-step/1954/1 "2022-03-18T10:36:08Z")

</div>

I have two kinds of agents, one with `queue=a`, one with `queue=b`.  
I have some steps I only want to run on `a` agents and some that I want to run on either `a` or `b` agents.  
Is it possible to configure two queues when specifying the agent selector on a pipeline step?

Note: We have more than these two queues so I can not just use “\*”

---

<div class="post-metadata">

**Author:** ![twometresteve2](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@twometresteve2](https://forum.buildkite.community/u/twometresteve2)\
**Post date:** [March 18, 2022, 11:04am UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-pipeline-step/1954/2 "2022-03-18T11:04:53Z")

</div>

I handled this scenario by looking at it from the other direction - tie agents rather than steps to multiple queues.

E.g. you have steps for building vanilla iOS apps and steps for building React Native apps on iOS. All your build servers can build iOS apps, but only some can build for React Native on iOS.

You then have agent config like:

Server type A (iOS only):

```auto
tags="queue=build-ios"

```

Server type B (iOS or React Native):

```auto
tags="queue=build-ios,queue=build-react-native"

```

Then you tie your steps to whatever they are doing, either `build-ios` or `build-react-native`.

---

<div class="post-metadata">

**Author:** ![sebastianleisinger](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sebastianleisinger](https://forum.buildkite.community/u/sebastianleisinger)\
**Post date:** [March 18, 2022, 11:55am UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-pipeline-step/1954/3 "2022-03-18T11:55:46Z")

</div>

Thanks a lot for the answer. I’ll go with this solution for now.

Still, I’m curious if something like regex are supported in the pipeline definition.

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [March 18, 2022, 2:36pm UTC](https://forum.buildkite.community/t/can-i-set-two-queues-for-a-pipeline-step/1954/4 "2022-03-18T14:36:36Z")

</div>

Hey @sebastianleisinger!

Welcome to the community! 😊

@twometresteve2 solution is what we also recommend for this situation 🙂  
You can use regex only on [conditionals](https://buildkite.com/docs/pipelines/conditionals).

Best!
