Runs
Run a workflow
Starts a run of an active workflow. Answers 202 at once with the execution and a Location: /v1/api/executions/<id> header; follow it with Get a run. Needs workflow:run.
POST
/
api
/
workflows
/
{id}
/
run
Run a workflow
curl --request POST \
--url https://api.hitl.sh/v1/api/workflows/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"order_id": "ORD-48252",
"customer": {
"name": "Mary Jackson",
"email": "mary@example.com"
},
"amount": 320,
"currency": "USD",
"reason": "Item never arrived."
},
"callback_url": "https://example.com/hitl/result"
}
'import requests
url = "https://api.hitl.sh/v1/api/workflows/{id}/run"
payload = {
"input": {
"order_id": "ORD-48252",
"customer": {
"name": "Mary Jackson",
"email": "mary@example.com"
},
"amount": 320,
"currency": "USD",
"reason": "Item never arrived."
},
"callback_url": "https://example.com/hitl/result"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
order_id: 'ORD-48252',
customer: {name: 'Mary Jackson', email: 'mary@example.com'},
amount: 320,
currency: 'USD',
reason: 'Item never arrived.'
},
callback_url: 'https://example.com/hitl/result'
})
};
fetch('https://api.hitl.sh/v1/api/workflows/{id}/run', 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.hitl.sh/v1/api/workflows/{id}/run",
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([
'input' => [
'order_id' => 'ORD-48252',
'customer' => [
'name' => 'Mary Jackson',
'email' => 'mary@example.com'
],
'amount' => 320,
'currency' => 'USD',
'reason' => 'Item never arrived.'
],
'callback_url' => 'https://example.com/hitl/result'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.hitl.sh/v1/api/workflows/{id}/run"
payload := strings.NewReader("{\n \"input\": {\n \"order_id\": \"ORD-48252\",\n \"customer\": {\n \"name\": \"Mary Jackson\",\n \"email\": \"mary@example.com\"\n },\n \"amount\": 320,\n \"currency\": \"USD\",\n \"reason\": \"Item never arrived.\"\n },\n \"callback_url\": \"https://example.com/hitl/result\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.hitl.sh/v1/api/workflows/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"order_id\": \"ORD-48252\",\n \"customer\": {\n \"name\": \"Mary Jackson\",\n \"email\": \"mary@example.com\"\n },\n \"amount\": 320,\n \"currency\": \"USD\",\n \"reason\": \"Item never arrived.\"\n },\n \"callback_url\": \"https://example.com/hitl/result\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/workflows/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"order_id\": \"ORD-48252\",\n \"customer\": {\n \"name\": \"Mary Jackson\",\n \"email\": \"mary@example.com\"\n },\n \"amount\": 320,\n \"currency\": \"USD\",\n \"reason\": \"Item never arrived.\"\n },\n \"callback_url\": \"https://example.com/hitl/result\"\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"msg": "Workflow run started",
"data": {
"id": "6af2da4b2ce04c173fe49697",
"workflow_id": "6af2ce4e8207961501f59472",
"workflow_name": "Refund approval",
"status": "running",
"finished": false,
"input": {
"amount": 320,
"currency": "USD",
"customer": {
"email": "mary@example.com",
"name": "Mary Jackson"
},
"order_id": "ORD-48252",
"reason": "Item never arrived."
},
"decisions": [],
"action_results": [],
"triggered_via": "api",
"started_at": "2026-11-10T08:48:11.693Z",
"completed_at": null
}
}{
"error": true,
"msg": "Invalid execution id"
}{
"error": true,
"msg": "Invalid API key"
}{
"error": true,
"code": "confirmation_required",
"msg": "Confirm the signup first: ask your human for the code in the email"
}{
"error": true,
"msg": "Workflow not found"
}{
"error": true,
"msg": "Workflow is a draft: publish and activate it in the editor first",
"status": "draft"
}{
"error": true,
"msg": "Rate limit exceeded"
}{
"error": true,
"msg": "<string>",
"code": "<string>"
}Authorizations
Your API key: hitl_live_…
Path Parameters
The workflow id
Example:
"6af2ce4e8207961501f59472"
Body
application/json
⌘I
Run a workflow
curl --request POST \
--url https://api.hitl.sh/v1/api/workflows/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"order_id": "ORD-48252",
"customer": {
"name": "Mary Jackson",
"email": "mary@example.com"
},
"amount": 320,
"currency": "USD",
"reason": "Item never arrived."
},
"callback_url": "https://example.com/hitl/result"
}
'import requests
url = "https://api.hitl.sh/v1/api/workflows/{id}/run"
payload = {
"input": {
"order_id": "ORD-48252",
"customer": {
"name": "Mary Jackson",
"email": "mary@example.com"
},
"amount": 320,
"currency": "USD",
"reason": "Item never arrived."
},
"callback_url": "https://example.com/hitl/result"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
order_id: 'ORD-48252',
customer: {name: 'Mary Jackson', email: 'mary@example.com'},
amount: 320,
currency: 'USD',
reason: 'Item never arrived.'
},
callback_url: 'https://example.com/hitl/result'
})
};
fetch('https://api.hitl.sh/v1/api/workflows/{id}/run', 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.hitl.sh/v1/api/workflows/{id}/run",
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([
'input' => [
'order_id' => 'ORD-48252',
'customer' => [
'name' => 'Mary Jackson',
'email' => 'mary@example.com'
],
'amount' => 320,
'currency' => 'USD',
'reason' => 'Item never arrived.'
],
'callback_url' => 'https://example.com/hitl/result'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.hitl.sh/v1/api/workflows/{id}/run"
payload := strings.NewReader("{\n \"input\": {\n \"order_id\": \"ORD-48252\",\n \"customer\": {\n \"name\": \"Mary Jackson\",\n \"email\": \"mary@example.com\"\n },\n \"amount\": 320,\n \"currency\": \"USD\",\n \"reason\": \"Item never arrived.\"\n },\n \"callback_url\": \"https://example.com/hitl/result\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.hitl.sh/v1/api/workflows/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"order_id\": \"ORD-48252\",\n \"customer\": {\n \"name\": \"Mary Jackson\",\n \"email\": \"mary@example.com\"\n },\n \"amount\": 320,\n \"currency\": \"USD\",\n \"reason\": \"Item never arrived.\"\n },\n \"callback_url\": \"https://example.com/hitl/result\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/workflows/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"order_id\": \"ORD-48252\",\n \"customer\": {\n \"name\": \"Mary Jackson\",\n \"email\": \"mary@example.com\"\n },\n \"amount\": 320,\n \"currency\": \"USD\",\n \"reason\": \"Item never arrived.\"\n },\n \"callback_url\": \"https://example.com/hitl/result\"\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"msg": "Workflow run started",
"data": {
"id": "6af2da4b2ce04c173fe49697",
"workflow_id": "6af2ce4e8207961501f59472",
"workflow_name": "Refund approval",
"status": "running",
"finished": false,
"input": {
"amount": 320,
"currency": "USD",
"customer": {
"email": "mary@example.com",
"name": "Mary Jackson"
},
"order_id": "ORD-48252",
"reason": "Item never arrived."
},
"decisions": [],
"action_results": [],
"triggered_via": "api",
"started_at": "2026-11-10T08:48:11.693Z",
"completed_at": null
}
}{
"error": true,
"msg": "Invalid execution id"
}{
"error": true,
"msg": "Invalid API key"
}{
"error": true,
"code": "confirmation_required",
"msg": "Confirm the signup first: ask your human for the code in the email"
}{
"error": true,
"msg": "Workflow not found"
}{
"error": true,
"msg": "Workflow is a draft: publish and activate it in the editor first",
"status": "draft"
}{
"error": true,
"msg": "Rate limit exceeded"
}{
"error": true,
"msg": "<string>",
"code": "<string>"
}