Skip to content

How to create workflow from yaml? #781

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

You must be logged in to vote

You can call wf.create() directly if you have set up a workflows_service on the Workflow. You shouldn't need to use WorkflowCreateRequest which is an auto-generated model class with limitations.

We can create the workflow in the same way as the https://hera.readthedocs.io/en/stable/walk-through/quick-start/#hello-world example - you can manipulate the Workflow object after loading it from yaml:

w = Workflow.from_yaml(template)
w.namespace="argo"  # if not in the yaml
w.workflows_service=WorkflowsService(host="https://localhost:2746")  # this property is Hera-specific
w.create()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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