Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Mermaid DAG with nested workflows #5843

Open
kdesnos opened this issue Mar 4, 2025 · 0 comments
Open

Invalid Mermaid DAG with nested workflows #5843

kdesnos opened this issue Mar 4, 2025 · 0 comments

Comments

@kdesnos
Copy link

kdesnos commented Mar 4, 2025

Bug report

Expected behavior and actual behavior

When using nested hierarchical workflow with more than 2 levels of hierarchy, in case where a workflow is instantiated several times below the first level of hierarchy, without any aliasing of the workflow name, the exported DAG with mermaid does not reflect the nextflow dag.

Steps to reproduce the problem

Consider the following MWE, where the sub_sub workflow is instantiated twice by two different sub_x workflows in the top level workflow.

process a {

    output:
        stdout

    script: 
    """
        echo "I'm a process"
    """
}

workflow sub_sub {
    a()
}

workflow sub_2 {
    sub_sub()
}

workflow sub_1 {
    sub_sub()
}

workflow {
    sub_1()
    sub_2()
}

Program output

The exported mermaid graph has the following code:

flowchart TB
    subgraph sub_1
    subgraph sub_sub
    v0([a])
    end
    end
    subgraph " "
    v1["-"]
    v3["-"]
    end
    subgraph sub_2
    subgraph sub_sub
    v2([a])
    end
    end
    v0 --> v1
    v2 --> v3

Which seems fine on paper. Unfortunately, mermaid can have a unique subgraph with name sub_sub, and as a result, when displaying the graph, two instances of a are displayed within sub_1::sub_sub, while the subgraph of sub_2 remains empty.

Image

Environment

  • Nextflow version: 24.10.4
  • Java version: openjdk 11.0.20 2023-07-18
  • Operating system: Linux
    • Bash version: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
@kdesnos kdesnos changed the title Invalid Mermaid DAG with nested workflow Invalid Mermaid DAG with nested workflows Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant