curl --request POST \
--url http://localhost:8080/v1/flows/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"service": "payments",
"message": "Connection refused: db-primary:5432"
}
}
'import requests
url = "http://localhost:8080/v1/flows/{id}/run"
payload = { "input": {
"service": "payments",
"message": "Connection refused: db-primary:5432"
} }
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: {service: 'payments', message: 'Connection refused: db-primary:5432'}})
};
fetch('http://localhost:8080/v1/flows/{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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/flows/{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' => [
'service' => 'payments',
'message' => 'Connection refused: db-primary:5432'
]
]),
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 := "http://localhost:8080/v1/flows/{id}/run"
payload := strings.NewReader("{\n \"input\": {\n \"service\": \"payments\",\n \"message\": \"Connection refused: db-primary:5432\"\n }\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("http://localhost:8080/v1/flows/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"service\": \"payments\",\n \"message\": \"Connection refused: db-primary:5432\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/flows/{id}/run")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"service\": \"payments\",\n \"message\": \"Connection refused: db-primary:5432\"\n }\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"runId": "<string>",
"nodes": {},
"output": {
"success": true,
"output": "<string>",
"data": "<unknown>",
"error": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Run a flow
Runs the flow and returns its trace. The response is 200 even when a node failed, so check ok.
Send Accept: text/event-stream to receive events while the run progresses. The event names are
node:start, node:done, node:error, node:skipped and provider:call, and the last event is
result with the same body as the JSON response. If the server is busy, the stream ends with a result
event that carries an error instead of an HTTP 503. Closing the connection cancels the run.
Send an Idempotency-Key to make retries safe. A retry with the same key and input returns the first
successful result with the header Idempotent-Replayed: true instead of running the flow again.
The header is ignored for event streams.
curl --request POST \
--url http://localhost:8080/v1/flows/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"service": "payments",
"message": "Connection refused: db-primary:5432"
}
}
'import requests
url = "http://localhost:8080/v1/flows/{id}/run"
payload = { "input": {
"service": "payments",
"message": "Connection refused: db-primary:5432"
} }
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: {service: 'payments', message: 'Connection refused: db-primary:5432'}})
};
fetch('http://localhost:8080/v1/flows/{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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/flows/{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' => [
'service' => 'payments',
'message' => 'Connection refused: db-primary:5432'
]
]),
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 := "http://localhost:8080/v1/flows/{id}/run"
payload := strings.NewReader("{\n \"input\": {\n \"service\": \"payments\",\n \"message\": \"Connection refused: db-primary:5432\"\n }\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("http://localhost:8080/v1/flows/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"service\": \"payments\",\n \"message\": \"Connection refused: db-primary:5432\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/flows/{id}/run")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"service\": \"payments\",\n \"message\": \"Connection refused: db-primary:5432\"\n }\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"runId": "<string>",
"nodes": {},
"output": {
"success": true,
"output": "<string>",
"data": "<unknown>",
"error": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
One of server.auth.tokens. With no tokens configured the API is open.
Headers
Any string that is unique per logical request, for example an MQ message id. Results are kept
for server.idempotencyTtlMs (default 10 minutes), per server instance, and are lost on restart.
Failed runs are not kept, so a retry after a failure runs again.
Path Parameters
Flow id.
Body
Run input. Templates read it as {{input.field}}.