# prefect-community

Mike Wochner

07/08/2021, 6:24 AM
Is it possible to fail a flow, if the agent is not available at the scheduled time? I would prefer this behavior in my case instead of the flow being marked late and start when the agent comes online.

Amanda Wee

07/08/2021, 7:23 AM
Thinking out loud: maybe you can have a flow state handler that checks for scheduled state. This way, you can retrieve the
, and if it is too long ago, you then return a failed state to cause the flow to fail.

Mike Wochner

07/08/2021, 10:40 AM
Ok. But that would happen at the time the agent comes online, correct? Until then, it would still appear as "Late"?

Kevin Kho

07/08/2021, 1:41 PM
Hey @Mike Wochner, this is something we offer in the Standard tier with Automations where you can cancel the flow run if it hasn’t run after a given amount of time. And Yes it would still appear as Late.