Skip to content

How to use non-default parameters when submitting a Workflow #1460

Answered by elliotgunton
rgasper asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @rgasper! At the moment the way to this is to set the values by the arguments on the Workflow. E.g. if you have a workflow like

# my_workflow.py
from hera.workflows import Workflow, script


@script()
def hello(s: str):
    print("Hello, {s}!".format(s=s))


with Workflow(
    generate_name="hello-world-",
    entrypoint="hello",
    arguments={"s": "world"},
) as w:
    hello()

Then you can import it and do

# submit_script.py
from my_workflow import w

w.arguments = {"s": "Hera"}
w.create()

I think adding an arguments parameter to the create function makes sense though to make this use case a one-liner (actually this should accept most if not all the Workflow attributes, then you coul…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rgasper
Comment options

Answer selected by elliotgunton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants