Skip to content

Pass Workflow attributes to the Workflow.create() function (including arguments, entrypoint, etc) #1463

@rgasper

Description

@rgasper

Is your feature request related to a problem? Please describe.
It's not currently easy from the codebase or example to understand how to supply non-default Parameters to a workflow that has already been created. As well, AFAICT there are no examples of this in the official documentation - or if there are, they are not easy to locate. I searched quite hard!

Describe the solution you'd 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()
# submit_script.py
from my_workflow import w

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

# requested implementation 
w.create(parameters={"s": "Hera")

Describe alternatives you've considered
The current implementation is an alternative to adding this new feature

Additional context
I think making this into an argument of the .create function would be more self-documenting, and should use the term parameter as that seems to more closely match Argo. However I'm just a starting Argo & Hera user at this point, so correct me if the term argument is more correct in this context! It does seem like these terms are getting mixed or are redundant with each other, and it's quite confusing as a new user.

https://argo-workflows.readthedocs.io/en/latest/walk-through/parameters/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions