<@ULVA73B9P> is it possible to search for flow run...
# ask-marvin
s
@Marvin is it possible to search for flow runs by certain parameters in prefect 2.10.x?
m
To help you better, could you please confirm the version of Prefect you're using? Prefect 2.x and 3.x have differences in their features and APIs, so knowing the version will allow me to give you the most accurate assistance.
In Prefect 2.10.x, you can indeed search or filter flow runs by certain parameters using the Prefect Python client. This involves retrieving a list of flow runs and filtering them based on specific criteria, such as their state, name, or parameters. For example, you can use asynchronous functions available in the Prefect client to list flow runs with specific states, and you can filter or process this list according to your custom parameters. Here's how you might approach it programmatically: 1. Connect to the Prefect Client: Use the Prefect client to establish a connection. 2. List Flow Runs: Use a method like
list_flow_runs_with_states(states)
to get flow runs in specific states. 3. Filter Flow Runs: You can then refine this list manually by checking each flow run's properties, including custom parameters that were used when the flow was deployed. For more detailed guidance, here is a link to the relevant Prefect documentation: Prefect 2.x Client Guide. This page includes examples of how to interact with and filter flow runs using the Prefect client. Let me know if you need further assistance or code examples!
s
What is the query for getting a paginated list of flow runs that include a certain key in flowRun.parameters