# Registering outputs with more than one possible type

**URL:** https://forum.qiime2.org/t/registering-outputs-with-more-than-one-possible-type/30832
**Category:** Developer Discussion
**Created:** [July 15, 2024, 7:14pm UTC](https://forum.qiime2.org/t/registering-outputs-with-more-than-one-possible-type/30832 "2024-07-15T19:14:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nicolesylvester](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicolesylvester/32/18964_2.png) [@nicolesylvester](https://forum.qiime2.org/u/nicolesylvester)
#### Post date: [July 15, 2024, 7:14pm UTC](https://forum.qiime2.org/t/registering-outputs-with-more-than-one-possible-type/30832/1 "2024-07-15T19:14:17Z")

</div>

I am creating a pipeline that runs a few different trimmer and aligner actions. The pipeline uses a config file that specifies what aligner and trimmer the pipeline should use. I want to save each intermediate step as output, however, depending on, for example, the type of aligner being used, the output could be one of two possible semantic types that I created. In addition, I wanted to be able to accept paired-end data or single-end data and output single-end or paired-end data from the trimming step in the pipeline. Is there a way to specify that the outputs in plugin\_setup can be one of two types? I am considering simply saving the data without returning it, but I would lose the provenance. I am open to any ideas on how to accomplish this, thank you!

---

<div class="post-metadata">

### Author: ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)
#### Post date: [July 15, 2024, 8:17pm UTC](https://forum.qiime2.org/t/registering-outputs-with-more-than-one-possible-type/30832/2 "2024-07-15T20:17:29Z")

</div>

Hi @nicolesylvester,  
It sounds like you want our typemap or typematch functionality.

We actually have new docs on both these functions! Check them out and let me know if you have any questions!

[https://develop.qiime2.org/en/latest/plugins/references/api/types.html#qiime2.plugin.TypeMap](https://develop.qiime2.org/en/latest/plugins/references/api/types.html#qiime2.plugin.TypeMap)

[https://develop.qiime2.org/en/latest/plugins/references/api/types.html#qiime2.plugin.TypeMatch](https://develop.qiime2.org/en/latest/plugins/references/api/types.html#qiime2.plugin.TypeMatch)
