## CancelWorkflowExecution `client.Automations.CancelExecution(ctx, body) (*AutomationCancelExecutionResponse, error)` **post** `/gitpod.v1.WorkflowService/CancelWorkflowExecution` Cancels a running workflow execution. Use this method to: - Stop long-running executions - Cancel failed executions - Manage resource usage ### Examples - Cancel execution: Stops a running workflow execution. ```yaml workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body AutomationCancelExecutionParams` - `WorkflowExecutionID param.Field[string]` ### Returns - `type AutomationCancelExecutionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Automations.CancelExecution(context.TODO(), gitpod.AutomationCancelExecutionParams{ WorkflowExecutionID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ```