Skip to content

prefect.utilities.context

get_task_and_flow_run_ids()

Get the task run and flow run ids from the context, if available.

Returns:

Type Description
Tuple[Optional[UUID], Optional[UUID]]

Tuple[Optional[UUID], Optional[UUID]]: a tuple of the task run id and flow run id

Source code in src/prefect/utilities/context.py
41
42
43
44
45
46
47
48
def get_task_and_flow_run_ids() -> Tuple[Optional[UUID], Optional[UUID]]:
    """
    Get the task run and flow run ids from the context, if available.

    Returns:
        Tuple[Optional[UUID], Optional[UUID]]: a tuple of the task run id and flow run id
    """
    return get_task_run_id(), get_flow_run_id()