-
Notifications
You must be signed in to change notification settings - Fork 715
Open
Labels
Description
New feature
I want to run an optional process only if the user has provided a secret. Example code:
workflow SUMMARY_WF {
main:
OPTIONAL_PROCESS()
}
process OPTIONAL_PROCESS {
secret "API_KEY"
output:
path "output/"
script:
"""
run_job.py
"""
}
Currently, if the user has not set the secret for OPTIONAL_PROCESS, the pipeline dies with the following error:
ERROR ~ Error executing process > 'SUMMARY_WF:OPTIONAL_PROCESS (1)'
Caused by:
Required secret is missing: 'API_KEY'
As far as I can tell from the Nextflow docs, the secret:
directive does not include an optional
parameter.
Usage scenario
To allow secrets to be optional instead of required. If the secret is not set for the target process, then the environmental variable is empty, and the pipeline developer can thus include a check for the env variable in their code (e.g., if os.getenv("API_KEY") is None:
).
Suggest implementation
Add an optional
parameter to the secrets:
directive.
zachary-foster