j

    jcozar

    1 year ago
    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!
    Kevin Kho

    Kevin Kho

    1 year ago
    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

    1 year ago
    Thank you!!
    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!
    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:
    {
      "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
      }
    }
    Kevin Kho

    Kevin Kho

    1 year ago
    I think this is easier to do from the automations tab in the UI
    j

    jcozar

    1 year ago
    I tried that, but I only saw actions like email slack or twilio, not flow sla’s
    Kevin Kho

    Kevin Kho

    1 year ago
    You don’t see these actions like cancelling the flow run? These are the SLAs. “does not finish” and “does not start”
    j

    jcozar

    1 year ago
    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!