Session API
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.
POST
/
api
/
sessions
/
validate
Validate a workflow
curl --request POST \
--url https://api.example.com/api/sessions/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
],
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"workflowId": "<string>",
"description": "Quality check"
}
'import requests
url = "https://api.example.com/api/sessions/validate"
payload = {
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
],
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"workflowId": "<string>",
"description": "Quality check"
}
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({
edges: [{source: '<string>', target: '<string>', sourcePort: '<string>'}],
nodes: [{nodeId: '<string>', type: '<string>', config: {}}],
workflowId: '<string>',
description: 'Quality check'
})
};
fetch('https://api.example.com/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_URL => "https://api.example.com/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([
'edges' => [
[
'source' => '<string>',
'target' => '<string>',
'sourcePort' => '<string>'
]
],
'nodes' => [
[
'nodeId' => '<string>',
'type' => '<string>',
'config' => [
]
]
],
'workflowId' => '<string>',
'description' => 'Quality check'
]),
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.example.com/api/sessions/validate"
payload := strings.NewReader("{\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ],\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\"\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.example.com/api/sessions/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ],\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/sessions/validate")
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 \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ],\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "<string>",
"outputPorts": {},
"valid": true,
"warnings": [
{
"field": "<string>",
"message": "<string>",
"nodeId": "<string>"
}
]
},
"error": "Bad Request",
"errors": [
{
"field": "sessionId",
"message": "Session not found: 'unknown-session'"
}
],
"message": "Operation successful",
"path": "/api/files",
"status": 200,
"timestamp": "2023-11-07T05:31:56Z"
}Authorizations
bearerAuthapiKeyAuth
Body
application/json
Definition of a reactive workflow DAG
Response
200 - */*
OK
Unified API response wrapper for both success and error responses. Success responses include data field; error responses include error, path, and errors fields.
⌘I
Validate a workflow
curl --request POST \
--url https://api.example.com/api/sessions/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
],
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"workflowId": "<string>",
"description": "Quality check"
}
'import requests
url = "https://api.example.com/api/sessions/validate"
payload = {
"edges": [
{
"source": "<string>",
"target": "<string>",
"sourcePort": "<string>"
}
],
"nodes": [
{
"nodeId": "<string>",
"type": "<string>",
"config": {}
}
],
"workflowId": "<string>",
"description": "Quality check"
}
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({
edges: [{source: '<string>', target: '<string>', sourcePort: '<string>'}],
nodes: [{nodeId: '<string>', type: '<string>', config: {}}],
workflowId: '<string>',
description: 'Quality check'
})
};
fetch('https://api.example.com/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_URL => "https://api.example.com/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([
'edges' => [
[
'source' => '<string>',
'target' => '<string>',
'sourcePort' => '<string>'
]
],
'nodes' => [
[
'nodeId' => '<string>',
'type' => '<string>',
'config' => [
]
]
],
'workflowId' => '<string>',
'description' => 'Quality check'
]),
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.example.com/api/sessions/validate"
payload := strings.NewReader("{\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ],\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\"\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.example.com/api/sessions/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ],\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/sessions/validate")
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 \"edges\": [\n {\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"sourcePort\": \"<string>\"\n }\n ],\n \"nodes\": [\n {\n \"nodeId\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"workflowId\": \"<string>\",\n \"description\": \"Quality check\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "<string>",
"outputPorts": {},
"valid": true,
"warnings": [
{
"field": "<string>",
"message": "<string>",
"nodeId": "<string>"
}
]
},
"error": "Bad Request",
"errors": [
{
"field": "sessionId",
"message": "Session not found: 'unknown-session'"
}
],
"message": "Operation successful",
"path": "/api/files",
"status": 200,
"timestamp": "2023-11-07T05:31:56Z"
}