Validate a workflow
Checks a draft workflow with the same rules as execution, without saving it. A failing draft is a 200 with valid=false. Also returns each node’s output ports for its configuration, so an editor can offer the right edge ports.
curl --request POST \
--url http://localhost:8080/api/sessions/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workflowId": "<string>",
"description": "Quality check",
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
]
}
'import requests
url = "http://localhost:8080/api/sessions/validate"
payload = {
"workflowId": "<string>",
"description": "Quality check",
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
]
}
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({
workflowId: '<string>',
description: 'Quality check',
nodes: [{nodeId: '<string>', type: '<string>', config: {}}],
edges: [{source: '<string>', target: '<string>', sourcePort: '<string>'}]
})
};
fetch('http://localhost:8080/api/sessions/validate', 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/api/sessions/validate",
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([
'workflowId' => '<string>',
'description' => 'Quality check',
'nodes' => [
[
'nodeId' => '<string>',
'type' => '<string>',
'config' => [
]
]
],
'edges' => [
[
'source' => '<string>',
'target' => '<string>',
'sourcePort' => '<string>'
]
]
]),
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/api/sessions/validate"
payload := strings.NewReader("{\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\",\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\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/api/sessions/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\",\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/sessions/validate")
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 \"workflowId\": \"<string>\",\n \"description\": \"Quality check\",\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"timestamp": "2023-11-07T05:31:56Z",
"status": 200,
"message": "Operation successful",
"data": {
"valid": true,
"message": "<string>",
"outputPorts": {}
},
"error": "Bad Request",
"path": "/api/files",
"errors": [
{
"field": "sessionId",
"message": "Session not found: 'unknown-session'"
}
]
}Authorizations
API key sent as Authorization: Bearer <key>. Needed only when the server has a key configured.
Body
Definition of a reactive workflow DAG
Unique workflow identifier
1A human-readable description of the workflow
256"Quality check"
Nodes in the workflow
1Show child attributes
Show child attributes
Edges connecting the nodes
Show child attributes
Show child attributes
Response
OK
Unified API response wrapper for both success and error responses. Success responses include data field; error responses include error, path, and errors fields.
The time the response was generated
The HTTP status code
200
A human-readable message
"Operation successful"
The response data
Show child attributes
Show child attributes
The HTTP status error name
"Bad Request"
The request path
"/api/files"
The list of field validation errors
Show child attributes
Show child attributes
curl --request POST \
--url http://localhost:8080/api/sessions/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workflowId": "<string>",
"description": "Quality check",
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
]
}
'import requests
url = "http://localhost:8080/api/sessions/validate"
payload = {
"workflowId": "<string>",
"description": "Quality check",
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
]
}
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({
workflowId: '<string>',
description: 'Quality check',
nodes: [{nodeId: '<string>', type: '<string>', config: {}}],
edges: [{source: '<string>', target: '<string>', sourcePort: '<string>'}]
})
};
fetch('http://localhost:8080/api/sessions/validate', 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/api/sessions/validate",
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([
'workflowId' => '<string>',
'description' => 'Quality check',
'nodes' => [
[
'nodeId' => '<string>',
'type' => '<string>',
'config' => [
]
]
],
'edges' => [
[
'source' => '<string>',
'target' => '<string>',
'sourcePort' => '<string>'
]
]
]),
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/api/sessions/validate"
payload := strings.NewReader("{\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\",\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\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/api/sessions/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\",\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/sessions/validate")
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 \"workflowId\": \"<string>\",\n \"description\": \"Quality check\",\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"timestamp": "2023-11-07T05:31:56Z",
"status": 200,
"message": "Operation successful",
"data": {
"valid": true,
"message": "<string>",
"outputPorts": {}
},
"error": "Bad Request",
"path": "/api/files",
"errors": [
{
"field": "sessionId",
"message": "Session not found: 'unknown-session'"
}
]
}