<@ULVA73B9P>, How can I use the API to fetch infor...
# ask-marvin
p
@Marvin, How can I use the API to fetch information about a flow after it has run?
m
To fetch information about a flow after it has run, you can use the Prefect API. The API attaches metadata about the created infrastructure to the flow run, referred to as the
infrastructure_pid
or infrastructure identifier. This identifier is composed of two parts: the Scope, which identifies where the infrastructure is running, and the ID, a unique identifier for the infrastructure within the scope. The identifiers for the primary infrastructure types are as follows: - Processes: The machine hostname and the PID. - Docker Containers: The Docker API URL and container ID. - Kubernetes Jobs: The Kubernetes API URL and job ID. Please note that flow run cancellation requires the flow run to be associated with a deployment. A monitoring process must be running to enforce the cancellation. Inline subflow runs, i.e., those created without
run_deployment
, cannot be cancelled without cancelling the parent flow run. If you may need to cancel a subflow run independent of its parent flow run, we recommend deploying it separately and starting it using the
run_deployment
method. For more detailed information, you can refer to the Prefect documentation here and here.