Hi all! I think that I read about this before but now I can't find it. I want to schedule a ETL daily to query some databases and load the data in an object store. If the prefect agent disconnects (let's say because of Internet connection problems) for more than one day, there would be more than one flow run queued. When the agent comes up again I would like that only the last flow run is executed and the others are cancelled. Is there something to implement this in prefect? Thank you very much!
k
Kevin Kho
06/18/2021, 1:28 PM
Hey @jcozar, this is a Prefect Cloud feature on the standard tier and up where you can have flow level SLAs that say these should not start is they are late for X amount of time
j
jcozar
06/21/2021, 7:45 AM
Thank you!!
jcozar
06/21/2021, 8:42 AM
I’ve been reading the documentation, the UI and the GraphQL interactive API and I don’t see how to create an action for a flow SLA failure. I am using the standard tier. Please, would you mind to give me a link with an example or something that I can read to understand it better? Thank you very much!
jcozar
06/21/2021, 8:59 AM
Ok I discovered the
create_flow_sla_config
and the
create_flow_group_sla
mutations. I created correctly the flow_sla_config but when I try to create the flow_group_sla the response rises an internal error. I used as flow_group_id the ID obtained from the Team/Flow Groups section:
Copy code
{
"errors": [
{
"path": [
"create_flow_group_sla"
],
"message": "Invalid flow group ID or SLA ID",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": {
"create_flow_group_sla": null
}
}
k
Kevin Kho
06/21/2021, 1:13 PM
I think this is easier to do from the automations tab in the UI
j
jcozar
06/21/2021, 1:44 PM
I tried that, but I only saw actions like email slack or twilio, not flow sla’s
k
Kevin Kho
06/21/2021, 1:47 PM
You don’t see these actions like cancelling the flow run? These are the SLAs. “does not finish” and “does not start”
j
jcozar
06/21/2021, 2:40 PM
Ok that was very useful! It has sense that only if I select one specific flow (not the option any flow) then the SLAs appears. Thank you very much again!
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.