What would be the best way to access variables fro...
# ask-community
m
What would be the best way to access variables from within a Flow in a State Handler? I'm making a Flow that runs Jupyter notebooks, and on failure I want to post a link to the failed notebook file to slack. There's a task earlier in the flow that generates the filepath.
I had a version in Prefect 1 that used something like this
Copy code
flow_run = FlowRunView.from_flow_run_id(flow_run_id=flow_run_id)
task_runs = flow_run.get_all_task_runs()
output_path_task = [
    x for x in task_runs if "make_output_path" in x.task_slug
][0]