# Workflows for master and develop

**URL:** <https://discuss.circleci.com/t/workflows-for-master-and-develop/37334>\
**Category:** Build Environment\
**Created:** [September 7, 2020, 1:42pm UTC](https://discuss.circleci.com/t/workflows-for-master-and-develop/37334 "2020-09-07T13:42:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Simon](https://discuss.circleci.com/u/Simon)\
**Post date:** [September 7, 2020, 1:42pm UTC](https://discuss.circleci.com/t/workflows-for-master-and-develop/37334/1 "2020-09-07T13:42:43Z")

</div>

I’m trying to create separate jobs for branch development and merges to master. I’ve arrived at the following but now see that both workflows are executed, when I had expected only one could ever be triggered. What am I misunderstanding?

```
workflows:
    build_branch:
        when:
            condition:
                not:
                    - equal: [master, << pipeline.git.branch >>]
        jobs:
            - side_chain_build
            - chrome_ex_build
            - web_upload_assets:
                    requires:
                        - side_chain_build
                        - elm_runtime_build
    build_release:
        when:
            condition:
                equal: [master, << pipeline.git.branch >>]
        jobs:
            - side_chain_build
            - elm_runtime_build
            - chrome_ex_build
            - web_upload_assets:
                    requires:
                        - side_chain_build
                        - elm_runtime_build
                        - chrome_ex_build
            - web_release:
                    requires:
                        - side_chain_tests
                        - web_upload_assets

```

what is the difference between `when` and `condition`

---

<div class="post-metadata">

**Author:** ![annapamela](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@annapamela](https://discuss.circleci.com/u/annapamela)\
**Post date:** [September 8, 2020, 9:25pm UTC](https://discuss.circleci.com/t/workflows-for-master-and-develop/37334/2 "2020-09-08T21:25:53Z")

</div>

Hi @Simon!

Thanks for posting the example. Instead of they keyword `condition`, can you try using a specific condition such as `and` or `or` after `when`. The keyword `when` indicates to check for a condition, while specific keywords So for example, can you try the following:

```auto
version: 2.1

jobs:
  test:
    docker:
      - image: circleci/node:latest
    steps:
      - run: echo << pipeline.git.branch >>

workflows:
    do_not_build:
      when:
        and:
          - not:
              equal: [master, << pipeline.git.branch >>]
      jobs:
          - test
    build:
        when:
          and:
            - equal: [master, << pipeline.git.branch >>]
        jobs:
            - test

```

I think that you bring up a very good point about `when` vs `condition`. So `condition` predates this conditional logic syntax, as it allows you to use parameters. I think what’s happening here is that something is getting passed into `condition`, and even though it should be interpreted as “condition: false”, instead the condition is accepting any value as true.

I’m bringing this to the larger team to get some more eyes on it, as I was able to reproduce this unexpected behavior. Thanks again for your thorough use of CircleCI!

---

<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:** [October 6, 2020, 2:15pm UTC](https://discuss.circleci.com/t/workflows-for-master-and-develop/37334/3 "2020-10-06T14:15:26Z")

</div>

Closed on October 6, 2020, 2:15pm UTC

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