This example showcases a simple artifact passing mechanism between two tasks.
The first task, writer, creates a file located at /file containing a message. The second
task, consumer, takes this artifact, places it at its own /file path, and print out the content.
fromhera.workflowsimportArtifact,NoneArchiveStrategy,Steps,Workflow,script@script(outputs=Artifact(name="out-art",path="/tmp/file",archive=NoneArchiveStrategy()))defwriter():withopen("/tmp/file","w")asf:f.write("Hello, world!")@script(inputs=Artifact(name="in-art",path="/tmp/file"))defconsumer():withopen("/tmp/file","r")asf:print(f.readlines())# prints `Hello, world!` to `stdout`withWorkflow(generate_name="artifact-",entrypoint="steps")asw:withSteps(name="steps"):w_=writer()c=consumer(arguments={"in-art":w_.get_artifact("out-art")})