# Issue with Nextflow Workflow Execution

**URL:** <https://community.seqera.io/t/issue-with-nextflow-workflow-execution/1104>\
**Category:** Ask for help\
**Created:** [August 16, 2024, 1:31am UTC](https://community.seqera.io/t/issue-with-nextflow-workflow-execution/1104 "2024-08-16T01:31:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onur\_oztornaci](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/onur_oztornaci/32/1004_2.png) [@onur\_oztornaci](https://community.seqera.io/u/onur_oztornaci)\
**Post date:** [August 16, 2024, 1:31am UTC](https://community.seqera.io/t/issue-with-nextflow-workflow-execution/1104/1 "2024-08-16T01:31:06Z")

</div>

Hi everyone,

I am struggleing with the workflow issue

```auto
process DNAm_Full_Matrix {
    input:
    path R_files, from: 'R_files/*'

    publishDir "${params.outdir}/DNAm_Full_Matrix", mode: 'copy', pattern: '*.csv'

    output:
    path "DNAm_Full_Matrix.csv", emit: DNAm_Full_Matrix, optional: true

    shell:
    """
    mkdir -p ${params.outdir}/DNAm_Full_Matrix
    Rscript ${baseDir}/bin/Full_DNAm_Matrix.R ${params.pipeline} ${params.outdir}/Methylation ${params.outdir}/DNAm_Full_Matrix
    """
}

```

Process 2: Estimate\_cell\_counts

```auto
process Estimate_cell_counts {
    input:
    path ecc, from: 'ecc/*'

    publishDir "${params.outdir}/Estimate_cell_count", mode: 'copy', pattern: '*.csv'

    output:
    path ("Estimate_cell_counts.csv"), emit: Estimate_cell_counts, optional: true

    shell:
    """
    mkdir -p ${params.outdir}/Estimate_cell_count
    Rscript ${baseDir}/bin/Estimate_cell_counts.R ${params.pipeline} ${baseDir}/data ${params.outdir}/DNAm_Full_Matrix ${params.outdir}/Estimate_cell_count
    """
}

```

Workflow:

```auto
Channel.empty()
    .mix(DNAm_Full_Matrix.out)
    .map { files -> files }
    .collect()
    .set { ecc }
Estimate_cell_counts(ecc)

```

if optional: false I m not able to create a dnam full matrix

What might be causing the workflow to not execute properly?

---

<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:** [August 16, 2024, 1:35am UTC](https://community.seqera.io/t/issue-with-nextflow-workflow-execution/1104/2 "2024-08-16T01:35:09Z")

</div>

Welcome to the forum, @onur_oztornaci!

This is DSL1 code and won’t work on recent versions of Nextflow. My first advice is to [convert it to DSL2](https://www.nextflow.io/docs/latest/dsl1.html).

Setting `optional` to true for an output will make the task end successfully even if the output wasn’t generated by the task. If your task is failing to produce such output, setting `optional` to false will make the task fail.

It’s also important to us to know what exactly people mean by sentences like “I can’t do this” or “It’s not working”. What do you mean by “I am not able to create a dnam full matrix”? Do you get an error? What error message? What Nextflow version are you using? What Operating System? Can you share the `.nextflow.log` file for this failed run? The more info and details you share, the better it is for us to help you 😃
