<@ULVA73B9P> For Prefect 2.x, is there a way to ha...
# ask-marvin
r
@Marvin For Prefect 2.x, is there a way to have a flow remain in a running state while waiting for an api call to update the status?
m
So, you want a flow to stay in a running state until a specific API call updates its status. Is that correct? I'll look this up for Prefect 2.x! To keep a flow in a running state while waiting for an API call to update its status in Prefect 2.x, you could use a pattern involving task polling. This involves periodically checking the API endpoint to determine if a certain condition has been met before proceeding. Here's a simplified outline: 1. Use a polling mechanism: Create a task that periodically polls your API endpoint. 2. Flow execution: Keep the flow in a running state by calling this polling task in a loop or using a delay between re-checks. While this isn't a built-in feature, it can be implemented with custom logic within your flow. Check these links for more context: - Custom Job Polling Integration - Prefect Automations and Triggers For advanced setups, you might need to create compound triggers to coordinate between multiple tasks or flows. Would you like more detailed implementation guidance?
r
I would want the job to call the Prefect server API to update status