Cancel Queued Run
curl --request POST \
--url https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel \
--header 'Authorization: <authorization>'import requests
url = "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"status": "<string>",
"completed_at": "<string>"
}Workflows
Cancel Queued Run
Cancel a workflow run that is still in the queue before execution starts.
POST
/
workflow-service
/
api
/
public
/
v1
/
workflow-runs
/
{runId}
/
cancel
Cancel Queued Run
curl --request POST \
--url https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel \
--header 'Authorization: <authorization>'import requests
url = "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/{runId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"status": "<string>",
"completed_at": "<string>"
}Cancels a workflow run that has not started executing yet. Only runs with status
QUEUED can be canceled.
Once a run moves to
STARTING, RUNNING, or any terminal status, cancellation is not possible. The API returns a 409 error.Parameters
string
required
Unique identifier for the workflow run to cancel. Returned as
run_id when you create a run.string
required
Bearer token. Format:
Bearer slat_<your-token>.Response
Returns200 OK with the canceled run details.
string
required
Unique identifier for the canceled run.
string
required
Updated status. Always
CANCELED on success.string
required
Timestamp when the run was canceled. ISO 8601 format.
Example
curl -s -X POST "https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/8c5e0f8a-2b35-4c1f-9b6a-9d0a6b3c1f4e/cancel" \
-H "Authorization: Bearer slat_YOUR_TOKEN"
import requests
response = requests.post(
"https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/8c5e0f8a-2b35-4c1f-9b6a-9d0a6b3c1f4e/cancel",
headers={
"Authorization": "Bearer slat_YOUR_TOKEN",
},
)
result = response.json()
print(result["status"])
const response = await fetch(
"https://api.slatehq.ai/workflow-service/api/public/v1/workflow-runs/8c5e0f8a-2b35-4c1f-9b6a-9d0a6b3c1f4e/cancel",
{
method: "POST",
headers: {
"Authorization": "Bearer slat_YOUR_TOKEN",
},
}
);
const result = await response.json();
console.log(result.status);
Response
{
"run_id": "8c5e0f8a-2b35-4c1f-9b6a-9d0a6b3c1f4e",
"status": "CANCELED",
"completed_at": "2026-01-27T01:24:00.000Z"
}
Status codes
| Status | Description |
|---|---|
200 | Run canceled. |
401 | Missing or invalid Bearer token. See Authentication. |
404 | Run not found. The runId does not exist or does not belong to this token. |
409 | Run is not cancelable. The run has already moved past the QUEUED status. |
500 | Internal server error. |
What’s next
- Create Workflow Run — Trigger a new workflow run.
- Get Run Status — Check run progress and results.
Was this page helpful?