Workflow
Creating Your First Workflow
In this guide we will create a simple workflow to return the sum of the square of all the elements in the list. following are the tasks we will be creating in the workflow
- Generate a list of numbers.
- Calculate the square of each number in the list.
- Sum the squared numbers.
Prerequisites
Before you proceed with the guide, make sure you have the following:
- Truefoundry CLI: Set up and configure the TrueFoundry CLI tool on your local machine by following the Setup for CLI guide.
- Workspace: To deploy your workflow, you’ll need a workspace. If you don’t have one, you can create it using this guide: Creating a Workspace or seek assistance from your cluster administrator.
Creating the Workflow
Create a workflow.py
where we will write the code for our workflow and place in the project root folder. (With other dependent files and requirements.txt)
workflow.py
⚠️Your workflow function should not contain any code or business logic, only defined tasks can be called in the workflow function and nothing else, else the workflow execution might fail.
You can also have map tasks and conditional tasks in your workflow. You can also run raw containers as tasks.
Now run the below command in the terminal to deploy your workflow, replace <workfspace-fqn>
with the workspace fqn which you can find on the UI.
View your deployed workflow
- You can view the deployed workflow by going to the workflow tab on dashboard.