https://flyte.org logo
#ask-the-community
Title
# ask-the-community
b

B

02/13/2024, 5:08 PM
👋 Hello, team! I'm very knew to Flyte and to workflow orchestration tools in general, so please forgive my newbie questions! I'm a bit confused when it comes to chaining tasks and workflows. I need to calculate the number of frames in a trajectory file for later use (depending on this number, I'll have to split the trajectory or not). So I wrote 2 tasks and 1 workflow to accomplish this. Problem is: how can I use this seamlessly in workflow ? Any help would be very much appreciated. Cheers,
g

Guy Harel

02/14/2024, 10:40 AM
This is understandably confusing 🙂 The tasks in a workflow return promises because the workflow doesn't execute instantly. It is parsed by Flyte's engine to create a graph of tasks that are chained together and run, some in parallel and some sequentially. To accomplish what you want, you would actually need to define a third task ("add_frames" for example), which would take as an input the results of the first two tasks, and perform the addition inside it. The way flyte will parse this workflow is that it will run the "number_of_frames" tasks in parallel, and once they are both complete, will run the "add_frames" task to add them together.