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.workflowsimportDAG,Artifact,NoneArchiveStrategy,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="d")asw:withDAG(name="d"):w_=writer()c=consumer(arguments=w_.get_artifact("out-art").with_name("in-art"))w_>>c