--- title: "When Condition" url: https://docs.catalyst.zoho.com/en/pipelines/help/catalyst-pipelines.yaml/build-the-pipeline/when-condition/ description: "Learn about the Catalyst Pipelines conditions in detail, the associated keywords and sample code snippets." last_updated: 2025-05-30T11:24:59Z service: Pipelines type: general related_links: - name: "Configure the Pipeline" url: /en/pipelines/help/catalyst-pipelines.yaml/implementation --- # When Condition # Introduction The when condition is a basic logic that can be configured to define the execution flow of the pipeline. You can define the when condition at the stage level, job level, or the pipeline level. It is important to note that the when condition can be applied at any of these levels, and the order of the components is not significant. The following operators can be used along with the when condition: ### when-equal ```yaml when: equal: - << status.build.package >> - success when-not-equal ``` ### when-not-equal ```yaml not-equal: - << status.build.package >> - failed ``` ### when-not ```yaml when: -not:true ``` ### when-and/when-or ```yaml when: or: - and: - equal: - << pipeline.status.build >> - success - not-equal: - << pipeline.status.build.hello-world >> - failed - equal: - << pipeline.event.{{Event Variable Placeholder}} >> ``` > **Note:** You will not be able to configure when conditions for [approval jobs](https://docs.catalyst.zoho.com/en/pipelines/help/catalyst-pipelines.yaml/build-the-pipeline/jobs/approval-job/). ### Global Configuration You can define a when condition at the pipeline level, if required. This condition solely determines the pipeline execution flow. You can configure the condition as follows: ```yaml pipeline-when: equal: - << event.ref >> - refs/heads/main ```