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?