# Pipeline combination operation

**URL:** <https://community.jenkins.io/t/pipeline-combination-operation/7895>\
**Category:** Using Jenkins\
**Created:** [June 8, 2023, 11:42am UTC](https://community.jenkins.io/t/pipeline-combination-operation/7895 "2023-06-08T11:42:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiuYingqing](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@LiuYingqing](https://community.jenkins.io/u/LiuYingqing)\
**Post date:** [June 8, 2023, 11:42am UTC](https://community.jenkins.io/t/pipeline-combination-operation/7895/1 "2023-06-08T11:42:52Z")

</div>

Can Steps in a Stage of a Pipeline Be Dependent? For example, there are step A, step B, step C, and step D in a stage. B and C depend on A. That is, B and C can be run only after A is run. B and C run at the same time, and D can only be run after C is finished. Is there any way to do that?

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [June 8, 2023, 12:04pm UTC](https://community.jenkins.io/t/pipeline-combination-operation/7895/2 "2023-06-08T12:04:34Z")

</div>

by default steps in a stage of a pipeline are executed sequentially  
you need to use the parallel step if you want to run something in parallel.  
See this simple pipeline

```auto
node() {
    sh 'echo step A'
    parallel stepB: {
        sh '''
          echo stepB
          sleep 2
          echo stepB
          sleep 2
          echo stepB
        '''
    },
    stepC: {
        sh '''
          echo stepC
          sleep 1
          echo stepC
          sleep 1
          echo stepC
        '''
        
    }
    sh 'echo stepD'
}

```

---

<div class="post-metadata">

**Author:** ![LiuYingqing](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@LiuYingqing](https://community.jenkins.io/u/LiuYingqing)\
**Post date:** [June 8, 2023, 12:09pm UTC](https://community.jenkins.io/t/pipeline-combination-operation/7895/3 "2023-06-08T12:09:00Z")

</div>

What if the dependencies between steps are complex?
