# Order-only dependencies in workflows

**URL:** <https://discuss.circleci.com/t/order-only-dependencies-in-workflows/28075>\
**Category:** Build Environment\
**Created:** [January 31, 2019, 12:54am UTC](https://discuss.circleci.com/t/order-only-dependencies-in-workflows/28075 "2019-01-31T00:54:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samf](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@samf](https://discuss.circleci.com/u/samf)\
**Post date:** [January 31, 2019, 12:54am UTC](https://discuss.circleci.com/t/order-only-dependencies-in-workflows/28075/1 "2019-01-31T00:54:16Z")

</div>

I have a situation where for some branches, we want to run a job before all other jobs, and on other branches we don’t want to run it all. I’ve achieved this by defining two workflows, but it feels redundant and I was wondering if there’s a better way. Here’s what I have now:

```
  build_and_archive:
  jobs:
    - build:
        filters:
          branches:
            ignore: /release\/.*/
    - archive:
        filters:
          branches:
            only:
              - master
        requires:
          - build

build_and_archive_rc:
  jobs:
    - get_rc_num:
        filters:
          branches:
            only: /release\/.*/
    - build:
        name: build_rc
        requires:
          - get_rc_num
    - archive:
        requires:
          - build_rc

```

What I’d like is a way to have just one workflow, and specify that build should depend on get\_rc\_num if get\_rc\_num is run, but if get\_rc\_num is filtered out, then build should run anyway.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [May 1, 2019, 12:54am UTC](https://discuss.circleci.com/t/order-only-dependencies-in-workflows/28075/2 "2019-05-01T00:54:18Z")

</div>

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