Hello all! Quick question, is it possible to run t...
# prefect-community
m
Hello all! Quick question, is it possible to run tasks inside a task? So for example:
Copy code
@task
my_inner_task():
 # do something

@task
def my_task_one():
  my_inner_task()
c
Hi Manuel - if you want to reuse task logic within another task you should instead call the
run
method directly:
Copy code
@task
my_inner_task():
 # do something

@task
def my_task_one():
  my_inner_task.run()
Note that when you do this, you are not asking Prefect to track the dependency or any stateful behavior of the inner task - instead you are simply reusing common python logic (which is perfectly valid)