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

Allow topic to be scoped to a named workflow #5591

Open
racosgrove opened this issue Dec 10, 2024 · 0 comments
Open

Allow topic to be scoped to a named workflow #5591

racosgrove opened this issue Dec 10, 2024 · 0 comments

Comments

@racosgrove
Copy link

racosgrove commented Dec 10, 2024

New feature

When a topic channel is used in a named workflow that is called multiple times via module aliasing there should be a way to scope the topic to the workflow.

Usage scenario

A named/sub workflow that is called multiple times serially via module aliasing effectively cannot use topics at present without breaking the rule of 'indirectly using a topic as input and output'. Scoped topic is highly useful for iterative workflows. The feature request is based on this discussion https://community.seqera.io/t/can-process-tasks-read-write-a-shared-path-directly-with-fusion/1523/5.

Suggest implementation

Suggestion #1

Allow topic scoping either implicitly when the Channel is defined within a named workflow block, or explicitly via a flag.

Channel.topic('my-topic', scope: 'workflow')

Suggestion #2

Keep all topic channels as global entities but allow dynamic topic naming within a process output the same way file names can be dynamic.

workflow X {
  Channel.topic("my-topic-${generation}")
  Y(generation)
}

process Y {
  input:
   val(gen)
   
  output:
    'output*.csv', topic: "my-topic-${gen}"  <- ERROR ~ No such variable: gen
}
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