# Multiple inputs with same meta map

**URL:** <https://community.seqera.io/t/multiple-inputs-with-same-meta-map/2485>\
**Category:** Ask for help\
**Tags:** nextflow\
**Created:** [December 4, 2025, 8:11pm UTC](https://community.seqera.io/t/multiple-inputs-with-same-meta-map/2485 "2025-12-04T20:11:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![topfm](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/topfm/32/2196_2.png) [@topfm](https://community.seqera.io/u/topfm)\
**Post date:** [December 4, 2025, 8:11pm UTC](https://community.seqera.io/t/multiple-inputs-with-same-meta-map/2485/1 "2025-12-04T20:11:20Z")

</div>

Hello!

I have a module in my workflow which parses upstream results for each sample.

```groovy
workflow test{
PARSE(
    TBLG.out.txt,
    KRAKEN2_KRAKEN2.out.report,
    QUALIMAP_BAMQC.out.results,
)
}

```

The inputs for this module are channels with meta() and then the result. The meta() should actually be the same for all three inputs, because each run is on one sample.

```groovy
    input:
    tuple val(meta), path(tblg)
    tuple val(meta2), path(kraken)
    tuple val(meta3), path(bamqc)

```

However, when I run this, I get the results from samples mixed up. It will be the tblg result from sample1, and the kraken from sample2, which is not ideal. I don’t know why this happens.

I tried:

```groovy
    input:
    tuple val(meta), path(tblg)
    tuple val(meta), path(kraken)
    tuple val(meta), path(bamqc)

```

But this doesn’t seem to work, either.  
Would the solution be to join the channels? Ex:

```groovy
input:
tuple val(meta), path(tblg), path(kraken), path(bamqc)

```

Any insight into what’s going on will be much appreciated!

---

<div class="post-metadata">

**Author:** ![robsyme](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/robsyme/32/342_2.png) [@robsyme](https://community.seqera.io/u/robsyme)\
**Post date:** [December 4, 2025, 8:21pm UTC](https://community.seqera.io/t/multiple-inputs-with-same-meta-map/2485/2 "2025-12-04T20:21:51Z")

</div>

> [@topfm](#):
>
> Would the solution be to join the channels

You’re absolutely right! The `join` operator will join items that share a key (the first element in the tuple by default), so you can:

```groovy
workflow {
  // some things

  TBLG.out.txt
  | join(KRAKEN2_KRAKEN2.out.report)
  | join(QUALIMAP_BAMQC.out.results)
  | MyNextProcess
}

process MyNextProcess {
  input: tuple val(meta), path(tblg), path(kraken), path(bamqc)
  // ... rest of the process

```

Give it a go and let me know how you get on!

---

<div class="post-metadata">

**Author:** ![bentsherman](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bentsherman/32/52_2.png) [@bentsherman](https://community.seqera.io/u/bentsherman)\
**Post date:** [December 4, 2025, 8:35pm UTC](https://community.seqera.io/t/multiple-inputs-with-same-meta-map/2485/3 "2025-12-04T20:35:41Z")

</div>

See the docs on [caching and resuming](https://nextflow.io/docs/latest/cache-and-resume.html#non-deterministic-process-inputs) for more details about why the inputs get mixed up incorrectly. It gives the same solution that Rob gave, using the `join` operator to combine the inputs into a single channel

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [December 11, 2025, 8:36pm UTC](https://community.seqera.io/t/multiple-inputs-with-same-meta-map/2485/4 "2025-12-11T20:36:02Z")

</div>

Closed on December 11, 2025, 8:36pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
