Hi, Is it possible to have a callback function whi...
# prefect-community
n
Hi, Is it possible to have a callback function which is called every time a flow changes its state which runs on the system where I kick off the flow rather than on the system actually running the flow? I tried
Flow(..., state_handlers=[…])
but the callback is called on the system where the flow is executed. My idea is to use
StartFlowRun
e.g. on my local computer which starts the flow in AWS cloud. And every time the state changes (
submitted
,
running
,
canceled
, etc.) a local callback function is called where I see the
state
and
flow_run_id
.
k
Hi @Nico Neumann, I think you can use Automations and you can have a hook to create flow run when a certain flow changes state. Or you can send a notification
🙌 1
a
+1 to what Kevin said If this didn't answer your question, can you first explain more what you try to do, i.e. what problem do you try to solve (without going into any technical implementation of state handler/ StartFlowRun/ AWS, etc)?
🙌 1
n
@Kevin Kho @Anna Geller Thanks, just tried it and it works!
👍 1