fromhera.workflowsimportDAG,Workflow,scriptfromhera.workflows.modelsimportSequence@script()defgen_num():importrandomprint(random.randint(4,6))@script()defsay(message:str):print(message)withWorkflow(generate_name="with-sequence-",entrypoint="d")asw:withDAG(name="d"):t1=gen_num(name="t1")# This Sequence counts up from 0 to the number# generated by the first taskt2=say(name="t2",with_sequence=Sequence(count=t1.result,start="0"),arguments={"message":"{{item}}"},)# This Sequence counts down to 1 from the number generated# by the first task, and uses a formatting string to give# the value of `{{item}}`t3=say(name="t3",with_sequence=Sequence(start=t1.result,end="1",format="2020-05-%02X",),arguments={"message":"{{item}}"},)t1>>[t2,t3]