How to create workflow from yaml? #781
-
I want to create workflow from a exist yaml file. wf = Workflow.from_yaml(template)
req = WorkflowCreateRequest(workflow=wf)
client.create_workflow(req, namespace=namespace) WorkflowCreateRequest(workflow=wf) wf type mismatch, wf is type ModelMapperMixin, not type Workflow. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can call 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 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() |
Beta Was this translation helpful? Give feedback.
You can call
wf.create()
directly if you have set up aworkflows_service
on theWorkflow
. You shouldn't need to useWorkflowCreateRequest
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: