https://prefect.io logo
m

Marwan Sarieddine

01/16/2021, 4:55 PM
Hi folks, question about inspecting prefect function tasks, is there a way to retrieve the arguments that are used to run the task. Please see a simple example in the thread.
Copy code
import prefect


@prefect.task
def add(x, y):
    return x + y


with prefect.Flow("test-flow") as flow:
    add(1, 2)

add_task = flow.get_tasks("add")[0]
is there a way to get back to
x=1
and
y=2
when inspecting
flow
or
add_task
?
ok I I see it is under
flow.constants
Copy code
flow.constants[add_task]
> {'x': 1, 'y': 2}
2 Views