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,Workflow,script@script(outputs=Artifact(name="test",path="/file"))defwriter():withopen("/file","w+")asf:f.write("Hello, world!")@script(inputs=Artifact(name="test",path="/file"))defconsumer():withopen("/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={"test":w_.get_artifact("test")})w_>>c