Skip to content

Instantly share code, notes, and snippets.

@acookin
acookin / agent.py
Created September 8, 2022 22:58
Agent + flow to cleanup local process flow runs
"""
Runs prefect agent
Keeps track of flow runs the agent kicked off,
and sets a DateTime block storage to NOW() for
every running flow, every couple of seconds.
Also, has a cleanup function that will set the state of
every running flow to AwaitingRetry for each running
flow.