Hi,
I am trying to create a flow based on some dynamic values. These dynamic values tell the tasks which are required to create that flow. My tasks are saved in separate files.
For eg:
task1.py
def task1():
@task
def run_terraform_lt():
tf = Terraform(working_dir="law_tf")
tf.init()
tf.apply()
task2.py
def task2():
@task
def run_terraform_rt():
tf = Terraform(working_dir="rt_tf")
tf.init()
tf.apply()
The input is similar to this:
{
"task1": {
"id": "foo",
"task_name": "task1"
},
"task2": {
"id": "bar",
"task_name": "task2",
}
}
I am getting the task name from this dictionary. Based on the value of "task_name", I have to create a flow combining all tasks.
I am creating a flow where I am trying to add them, but the tasks are not getting added in the flow. Anyone has any idea on how this can be achieved? Here is the snippet of my flow creation code. It is inside a for loop through which I am extracting the task name and other variables.