Hey Prefect team! we have created alot of actions ...
# ask-community
c
Hey Prefect team! we have created alot of actions under automations (various pager duty instances to different environments). Now we want to clean some up; how do we remove an action?
k
Hi @Charles Leung, unfortunately this is not exposed yet in the UI. You’ll need to use the GraphQL API. Are these attached to Flows or Agents?
c
they're attached to flows - can you send me a sample graphql query?
k
Copy code
query {
  flow_sla_config {
    id
    kind
    flow_groups {
      id
    }
    duration_seconds
  }
}
This gets the Flow SLA Config
c
hm, but is there a specific query that can delete an action? 😞
k
Yes one sec
Copy code
mutation {
  delete_flow_sla_config(input: {flow_sla_config_id: "<id-here>"}) {
    success
  }
}
This is to delete after you get the id
c
got it, thanks kevin i'll test this out
k
Hey Charles, I was wrong earlier this will be easier.
Copy code
mutation {
  delete_action (input: {action_id: ""}) {
    success
  }
}
j
To get action ids you can run:
Copy code
query {
  action {
    name
    id
    action_config
  }
}