# Conditional Workflows

**URL:** <https://discuss.circleci.com/t/conditional-workflows/43115>\
**Category:** Build Environment\
**Tags:** pipelines, workflow\
**Created:** [March 2, 2022, 10:13pm UTC](https://discuss.circleci.com/t/conditional-workflows/43115 "2022-03-02T22:13:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettjohnsen-sy](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brettjohnsen-sy/32/27566_2.png) [@brettjohnsen-sy](https://discuss.circleci.com/u/brettjohnsen-sy)\
**Post date:** [March 2, 2022, 10:13pm UTC](https://discuss.circleci.com/t/conditional-workflows/43115/1 "2022-03-02T22:13:42Z")

</div>

I am trying to create a conditional workflow that only executes once every night when the following items are met:

- pipeline is a scheduled pipeline
- scheduled pipeline matches a specific name
- the specified branch has a new git revision (changes have been pushed since last)

I have a trigger set to the desired branch in a Scheduled Trigger in my project settings. And now I am trying to configure the CircleCI `config.yml` file. But I am having a hard time getting the above logic to not cause errors when linting if the `config.yml` is valid.

The issue is specifically with trying to include `and`/`equal` logic with the `not` logic. I am not sure how to write the logic for the last bullet point where “this pipeline string variable should NOT equal this other pipeline string variable”

Below is my attempt at this logic, but as I said, it fails the valid config check:

```auto
workflows:
  version: 3
  deploy_nightly:
    when:
        and:
            - equal: [scheduled_pipeline, << pipeline.trigger_source >>]
            - equal: ["Release Nightly Delivery", << pipeline.schedule.name >>]
            - not:
                - equal: [<< pipline.git.revision >>, << pipeline.git.base_revision >>]
    jobs:
        - shared_setup_simulator
        - deploy_release:
            context:
              - some_context

```

Any help would be greatly appreciated!
