Hi, I am new to prefect but very excited to try i...
# ask-community
c
Hi, I am new to prefect but very excited to try it out. I am setting up my use case but running into some issues. Are we not meant to have tasks call other tasks? Should tasks be only called from within a flow directly? I am getting a 'Could not infer an active Flow context' exception
k
Hey, you can use a task in another task by calling the
run
method.
Copy code
@task
def abc():
    return 1

@task
def bcd():
    x = abc.run()
    return x+1
This will use the Python function under the hood