Guides
Passing Files/Artifacts Between Tasks
In Workflow, FlyteFile and FlyteDirectory are special types representing files and directory that can be passed between tasks in a workflow. It helps manage and track files and directories, ensuring that they can be accessed and moved across different execution environments.
Passing files across tasks
- In the above example we are creating a
sample.txt
file in acreate_file
task and then returning that file as FlyteFile and then inread_and_print_file
task we are taking the flyteFile as input and then printing the content of the file.
Passing directory across tasks
- In the above example, we are creating multiple files in
/tmp/sample_directory
directory increate_directory
task and then we are passing this directory inread_and_print_directory
task to print the files in that directory and the content of these files.