Create Workflow Run
curl --request POST \
--url https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"inputs": {}
}'import requests
url = "https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs"
payload = { "inputs": {} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {}})
};
fetch('https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs', 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/workflows/{workflowId}/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs"
payload := strings.NewReader("{\n \"inputs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
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/workflows/{workflowId}/runs")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {}\n}"
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"status": "<string>",
"workspace_id": 123,
"workflow_execution_id": "<string>",
"status_url": "<string>"
}Workflows
Create Workflow Run
Trigger a new asynchronous run for a specific workflow.
POST
/
workflow-service
/
api
/
public
/
v1
/
workflows
/
{workflowId}
/
runs
Create Workflow Run
curl --request POST \
--url https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"inputs": {}
}'import requests
url = "https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs"
payload = { "inputs": {} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {}})
};
fetch('https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs', 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/workflows/{workflowId}/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs"
payload := strings.NewReader("{\n \"inputs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
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/workflows/{workflowId}/runs")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/workflow-service/api/public/v1/workflows/{workflowId}/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {}\n}"
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"status": "<string>",
"workspace_id": 123,
"workflow_execution_id": "<string>",
"status_url": "<string>"
}Starts a new run for the specified workflow. The run is queued and processed asynchronously. Use the Get Run Status endpoint to poll for progress.
Parameters
string
required
Unique identifier for the workflow to run. Find this in the Slate dashboard under the workflow’s settings.
string
required
Bearer token. Format:
Bearer slat_<your-token>.string
Optional unique key to prevent duplicate runs. If you send the same key with the same
workflowId, the API returns the existing run instead of creating a new one. A key reused with a different workflowId returns a 409 error.object
required
Key-value pairs that map to the workflow’s input parameters. The required keys depend on the specific workflow.
Response
Returns202 Accepted with the queued run details.
string
required
Unique identifier for the created run. Use this to poll status or cancel the run.
string
required
Initial status of the run. Always
QUEUED for new runs.number
Workspace ID assigned to the run. May be
null until the run starts processing.string
Internal execution ID. May be
null until the run starts processing.string
required
Relative URL to poll the run status. Append to the base URL to get the full path.
Example
curl -s -X POST "https://api.slatehq.ai/workflow-service/api/public/v1/workflows/wf_abc123/runs" \
-H "Authorization: Bearer slat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: my-unique-key-001" \
--data-raw '{
"inputs": {
"brandDomain": "example.com"
}
}'
import requests
response = requests.post(
"https://api.slatehq.ai/workflow-service/api/public/v1/workflows/wf_abc123/runs",
headers={
"Authorization": "Bearer slat_YOUR_TOKEN",
"Content-Type": "application/json",
"Idempotency-Key": "my-unique-key-001",
},
json={
"inputs": {
"brandDomain": "example.com",
},
},
)
run = response.json()
print(run["run_id"], run["status"])
const response = await fetch(
"https://api.slatehq.ai/workflow-service/api/public/v1/workflows/wf_abc123/runs",
{
method: "POST",
headers: {
"Authorization": "Bearer slat_YOUR_TOKEN",
"Content-Type": "application/json",
"Idempotency-Key": "my-unique-key-001",
},
body: JSON.stringify({
inputs: {
brandDomain: "example.com",
},
}),
}
);
const run = await response.json();
console.log(run.run_id, run.status);
Response
{
"run_id": "8c5e0f8a-2b35-4c1f-9b6a-9d0a6b3c1f4e",
"status": "QUEUED",
"workspace_id": null,
"workflow_execution_id": null,
"status_url": "/workflow-service/api/public/v1/workflow-runs/8c5e0f8a-2b35-4c1f-9b6a-9d0a6b3c1f4e"
}
Status codes
| Status | Description |
|---|---|
202 | Run created and queued. |
400 | Invalid request. workflow_id is missing or inputs is not an object. |
401 | Missing or invalid Bearer token. See Authentication. |
403 | Invalid API token context. The token does not have access to the requested workspace. |
409 | Idempotency key conflict. The same key was used with a different workflowId. |
429 | Rate limit reached. Either the daily run limit or concurrent run limit has been exceeded. |
500 | Internal server error. |
Run lifecycle
After creation, a run progresses through these statuses:- QUEUED — The run is waiting to be picked up.
- STARTING — The run is initializing (creating workspace, starting execution).
- RUNNING — The workflow is actively executing.
- COMPLETED — The workflow finished. Output is available via Get Run Status.
- FAILED — The workflow encountered an error. Check the
errorfield for details. - CANCELED — The run was canceled while queued.
You can only cancel a run while the status is
QUEUED. Once a run moves to STARTING or later, cancellation is not possible.What’s next
- Get Run Status — Poll for run progress and results.
- Cancel Queued Run — Cancel a run before execution starts.
- Authentication — Create and manage API tokens.
Was this page helpful?