Expression condition and nested condition // Declarative // pipeline { agent any stages { stage('Example Build') { steps { echo 'Hello World' } } stage('Example Deploy') { when { expression { BRANCH_NAME ==~ /(production|staging)/ } anyOf { environment name: 'DEPLOY_TO', value: 'production' environment name: 'DEPLOY_TO', value: 'staging' } } steps { echo 'Deploying' } } } } // Script // Parallel Example Stages in Declarative Pipeline may declare a number of nested stages within them, which will be executed in parallel. Note that a stage must have one and only one of either  steps  or  parallel . The nested stages cannot contain further  parallel  stages themselves, but otherwise behave the same as any other  stage . Any stage containing  parallel  cannot contain  agent  or  tools , since those are not relevant without  steps . In addition, you can force your  parallel stage`s to all be aborted when one of them fails, by adding `failFast true  to the  stage  containing the  parallel . 98