https://prefect.io logo
Title
c

Constantino Schillebeeckx

02/14/2023, 7:55 PM
is it possible to create Automations using the GraphQL API? This seems to suggest there is; however it seems like you can only create actions, and not Automations. The docs don't return anything for
automation
1
k

Kalise Richmond

02/14/2023, 8:36 PM
Hi @Constantino Schillebeeckx I think if you look in the interactive api for "sla" you'll find where you can set up automations
c

Constantino Schillebeeckx

02/14/2023, 8:39 PM
hmmm are there broader docs for SLA? I'm not sure how an automation for a failed flow would fit under an SLA concept.
k

Kalise Richmond

02/14/2023, 8:47 PM
Ah yes I'm not seeing anything for Automations inside the interactive graphql. When I create an automation inside the UI and inspect the network calls I do see a mutation calling CreateFlowRunStateChangedHook with this as the example mutation
mutation CreateFlowRunStateChangedHook($input: create_flow_run_state_changed_hook_input!) {
  create_flow_run_state_changed_hook(input: $input) {
    id
    __typename
  }
}
with these variables
{
  "input": {
    "flow_group_ids": [
      "xxx"
    ],
    "action_id": "1fe6ece3-b683-4758-b801-38fd8e9be8e7",
    "states": [
      "Failed",
      "Timedout",
      "Triggerfailed"
    ]
  }
}
c

Constantino Schillebeeckx

02/14/2023, 8:50 PM
that looks like the ticket
🎉 1