Hi! I'm fairly new to prefect and I wanted to ask ...
# prefect-server
z
Hi! I'm fairly new to prefect and I wanted to ask about the manual_only trigger for a task. For a task that's waiting for manual approval, does the server expose an API that I can call to send the approval signal? I have my Prefect server up on Kubernetes. Thanks in advance
n
Hi @Zhilong Li - yes! You can approve the task by setting the state of your task run to `Resume`; this can be done with this mutation:
Copy code
mutation setTaskRunStates($input: [set_task_run_state_input!]!) {
  set_task_run_states(input: { states: $input }) {
    states {
      id
    }
  }
}
where
$input
is a payload that looks like this:
Copy code
[{
"version": string,
"task_run_id": uuid!,
"state": {
  type: string!, ("Resume", in this case)
  message: string
}]
z
ah, so i'll need to interface with the graphql api. Thank you for the response and thank you for building such a great product!
n
You don't need to use the api! The UI exposes tasks that are awaiting approval which can be resumed from there. However if you're interacting with the system through code you'll need to use the graphql api
Glad you're finding some value from the product 🙂
🙌 1