Execute Workflow
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": [
{}
],
"cancel_existing": false
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute"
payload = {
"input": [{}],
"cancel_existing": False
}
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: [{}], cancel_existing: false})
};
fetch('https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute', 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://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute",
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' => [
[
]
],
'cancel_existing' => false
]),
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://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute"
payload := strings.NewReader("{\n \"input\": [\n {}\n ],\n \"cancel_existing\": false\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://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {}\n ],\n \"cancel_existing\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute")
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 {}\n ],\n \"cancel_existing\": false\n}"
response = http.request(request)
puts response.read_body{
"workflow_run_id": "<string>",
"workflow_id": "<string>",
"workflow_name": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"poll_url": "<string>",
"workflow_url": "<string>",
"total_nodes": 123,
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Flows
Execute Workflow
Execute a workflow with input data.
- workflow_id: The ID of the workflow to execute
- input: List of input data records to process
Returns execution info including workflow_run_id for polling.
POST
/
public
/
workflows
/
{workflow_id}
/
execute
Execute Workflow
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": [
{}
],
"cancel_existing": false
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute"
payload = {
"input": [{}],
"cancel_existing": False
}
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: [{}], cancel_existing: false})
};
fetch('https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute', 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://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute",
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' => [
[
]
],
'cancel_existing' => false
]),
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://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute"
payload := strings.NewReader("{\n \"input\": [\n {}\n ],\n \"cancel_existing\": false\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://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {}\n ],\n \"cancel_existing\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/workflows/{workflow_id}/execute")
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 {}\n ],\n \"cancel_existing\": false\n}"
response = http.request(request)
puts response.read_body{
"workflow_run_id": "<string>",
"workflow_id": "<string>",
"workflow_name": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"poll_url": "<string>",
"workflow_url": "<string>",
"total_nodes": 123,
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Body
application/json
Response
Successful Response
⌘I