# How to call a process of a workflow after two workflows output are complete?

**URL:** <https://community.seqera.io/t/how-to-call-a-process-of-a-workflow-after-two-workflows-output-are-complete/665>\
**Category:** Ask for help\
**Created:** [April 17, 2024, 3:08pm UTC](https://community.seqera.io/t/how-to-call-a-process-of-a-workflow-after-two-workflows-output-are-complete/665 "2024-04-17T15:08:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [April 17, 2024, 3:08pm UTC](https://community.seqera.io/t/how-to-call-a-process-of-a-workflow-after-two-workflows-output-are-complete/665/1 "2024-04-17T15:08:44Z")

</div>

Hello there,

I’ve multiple workflows and each workflow has different processes.

After I’m through with two workflows I’m interested in integrating output from different steps of these workflows.

I’d like to have a workflow, say named as integrate. In this integrate I’d like to put different processes such as combine\_p1\_p2, combine\_p3\_p4.

I’ve main.nf as:

```auto

include { rna } from './workflows/rna'
include { wes } from './workflows/wes'
include { integrate_RNA_WES} from './workflows/integrate'

workflow {

    if (params.analysis=="both"){
        wes()
        rna()

        wes.out.parsed_cnv.view()
        rna.out.merged_rdata.view()
 
    }
}

```

In integrate workflow, I’d like to put few processes. These are mostly custom scripts.

In integrate workflow I’ve:

```auto

include {integrate_parsed_CNV_merged_RNA } from '../modules/integrate/processes_integrate.nf'
workflow integrate_RNA_WES {

integrate_parsed_CNV_merged_RNA()

}

```

I’ve processes\_integrate.nf as:

```auto
process integrate_parsed_CNV_merged_RNA {

input:
output:
script:
"""
"""

}

process integrate_files_diff {
input:
output:
script:

"""
"""
}

```

How do I call `integrate_parsed_CNV_merged_RNA` of `integrate.nf` once I’ve output from wes’s parsed\_CNV and rna’s merged\_feature?

Sorry this may seem complicated and confusing.

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [April 17, 2024, 3:25pm UTC](https://community.seqera.io/t/how-to-call-a-process-of-a-workflow-after-two-workflows-output-are-complete/665/2 "2024-04-17T15:25:21Z")

</div>

I’m sorry, I don’t understand where this question is coming from. If you have a process or a workflow that depends on something, it will start when this something is available. It doesn’t matter if it’s a subworkflow or a process, you just tell what your subworkflow or process needs, and Nextflow will make sure to spin it up when what it needs is available.

There are multiple famous nf-core pipelines that do exactly that. Many modules and subworkflows working together. Have a look at nf-core/rnaseq [here](https://github.com/nf-core/rnaseq/blob/b89fac32650aacc86fcda9ee77e00612a1d77066/workflows/rnaseq.nf), for example.

---

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [April 17, 2024, 3:27pm UTC](https://community.seqera.io/t/how-to-call-a-process-of-a-workflow-after-two-workflows-output-are-complete/665/3 "2024-04-17T15:27:32Z")

</div>

@mribeirodantas  
Thank you for your response.

Yes, how do I call/execute it?

Is there a way to call a particular workflow’s process, say:

```auto
integrate.integrate_parsed_CNV_merged_RNA( wes.out.parsed_cnv, rna.out.merged_rdata)

```

Does it make sense now?

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [April 17, 2024, 3:55pm UTC](https://community.seqera.io/t/how-to-call-a-process-of-a-workflow-after-two-workflows-output-are-complete/665/4 "2024-04-17T15:55:05Z")

</div>

You can learn more about how subworkflow works, with examples, in the official documentation [here](https://www.nextflow.io/docs/latest/workflow.html) and in the fundamentals Nextflow training [here](https://training.nextflow.io/basic_training/modules/#workflow-definition). Besides, I really like checking nf-core pipelines source code to see how skilled Nextflow developers do thing. I highly recommend you reading this material and checking the source code of [these pipelines](https://github.com/nf-core). Otherwise, it’ll be very hard for you to progress on your Nextfllow journey.
