Workflow state dependency #4204
-
Hello, I have a workflow that consists of two different "subworkflows". The first workflow finishes with one process whose errorStrategy is to "ignore" because sometimes there are jobs that fail for unexpected reasons in the cluster, but when you "resume" it works again. To run the second workflow, I need that all the tasks from the first workflow are completed. So probably I will have to run "resume" several times on the first one. My question is...how can I do it to automatically start the second workflow once all the tasks of the first one have been completed successfully? If it's easier to do it with processes instead of workflows I can also join them. Thanks in advance for your help!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
If you can work at the level of processes, then: https://nextflow-io.github.io/patterns/process-collect/. If there isn't a channel dependency between this next process that needs all else to be finished before it starts, you can create a state dependency (read more at https://nextflow-io.github.io/patterns/state-dependency/) and use |
Beta Was this translation helpful? Give feedback.
-
You should be able to keep your workflows as they are and block until all samples have succeeded. You can use the |
Beta Was this translation helpful? Give feedback.
If you know beforehand the number of elements that you should receive at process 2, you can use the
when
block in the process to only instantiate the process if the number of elements is the one you expect. Or you can pass this through a map to the process and decide to interrupt the workflow if it's different from what you expected.