fromtyping_extensionsimportAnnotatedfromhera.sharedimportglobal_configfromhera.workflowsimportInput,Output,Parameter,Workflowfromhera.workflows.modelsimportSuppliedValueFrom,ValueFromglobal_config.experimental_features["decorator_syntax"]=True# We start by defining our Workfloww=Workflow(generate_name="suspend-workflow-")# This defines the template's inputsclassMyInput(Input):approve:Annotated[str,Parameter(description="Choose YES to continue workflow and deploy to production",enum=["YES","NO"],),]="NO"classMyOutput(Output):approve:Annotated[str,Parameter(name="approve",value_from=ValueFrom(supplied=SuppliedValueFrom(),),),]# We then use the decorators of the `Workflow` object# to set the entrypoint and create a Suspend template@w.set_entrypoint@w.suspend_template()defbasic_hello_world(my_input:MyInput)->MyOutput:...
apiVersion:argoproj.io/v1alpha1kind:Workflowmetadata:generateName:suspend-workflow-spec:entrypoint:basic-hello-worldtemplates:-name:basic-hello-worldinputs:parameters:-name:approvedefault:'NO'description:Choose YES to continue workflow and deploy to productionenum:-'YES'-'NO'outputs:parameters:-name:approvevalueFrom:supplied:{}suspend:{}