Validate a workflow definition
curl --request POST \
--url https://v1.api.altostrat.io/workflows/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Daily Network Health Check",
"authorization_id": "auth_01H...",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 150,
"y": 250
},
"data": {
"componentId": "manual_trigger"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2",
"sourceHandle": "true"
}
],
"description": "<string>",
"is_active": true,
"schedule_type": "manual",
"schedule_value": "0 4 * * *"
}
'import requests
url = "https://v1.api.altostrat.io/workflows/validate"
payload = {
"name": "Daily Network Health Check",
"authorization_id": "auth_01H...",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 150,
"y": 250
},
"data": { "componentId": "manual_trigger" }
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2",
"sourceHandle": "true"
}
],
"description": "<string>",
"is_active": True,
"schedule_type": "manual",
"schedule_value": "0 4 * * *"
}
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({
name: 'Daily Network Health Check',
authorization_id: 'auth_01H...',
nodes: [
{
id: 'n1',
type: 'manual_trigger',
position: {x: 150, y: 250},
data: {componentId: 'manual_trigger'}
}
],
edges: [{id: 'e1-2', source: 'n1', target: 'n2', sourceHandle: 'true'}],
description: '<string>',
is_active: true,
schedule_type: 'manual',
schedule_value: '0 4 * * *'
})
};
fetch('https://v1.api.altostrat.io/workflows/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://v1.api.altostrat.io/workflows/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([
'name' => 'Daily Network Health Check',
'authorization_id' => 'auth_01H...',
'nodes' => [
[
'id' => 'n1',
'type' => 'manual_trigger',
'position' => [
'x' => 150,
'y' => 250
],
'data' => [
'componentId' => 'manual_trigger'
]
]
],
'edges' => [
[
'id' => 'e1-2',
'source' => 'n1',
'target' => 'n2',
'sourceHandle' => 'true'
]
],
'description' => '<string>',
'is_active' => true,
'schedule_type' => 'manual',
'schedule_value' => '0 4 * * *'
]),
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://v1.api.altostrat.io/workflows/validate"
payload := strings.NewReader("{\n \"name\": \"Daily Network Health Check\",\n \"authorization_id\": \"auth_01H...\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 150,\n \"y\": 250\n },\n \"data\": {\n \"componentId\": \"manual_trigger\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\",\n \"sourceHandle\": \"true\"\n }\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"schedule_type\": \"manual\",\n \"schedule_value\": \"0 4 * * *\"\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://v1.api.altostrat.io/workflows/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Daily Network Health Check\",\n \"authorization_id\": \"auth_01H...\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 150,\n \"y\": 250\n },\n \"data\": {\n \"componentId\": \"manual_trigger\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\",\n \"sourceHandle\": \"true\"\n }\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"schedule_type\": \"manual\",\n \"schedule_value\": \"0 4 * * *\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/workflows/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 \"name\": \"Daily Network Health Check\",\n \"authorization_id\": \"auth_01H...\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 150,\n \"y\": 250\n },\n \"data\": {\n \"componentId\": \"manual_trigger\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\",\n \"sourceHandle\": \"true\"\n }\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"schedule_type\": \"manual\",\n \"schedule_value\": \"0 4 * * *\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [
"<string>"
]
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}Workflows
Validate a workflow definition
Validates a workflow graph before you create or update it. Use this to catch missing triggers, invalid node configuration, and graph errors.
POST
/
workflows
/
validate
Validate a workflow definition
curl --request POST \
--url https://v1.api.altostrat.io/workflows/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Daily Network Health Check",
"authorization_id": "auth_01H...",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 150,
"y": 250
},
"data": {
"componentId": "manual_trigger"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2",
"sourceHandle": "true"
}
],
"description": "<string>",
"is_active": true,
"schedule_type": "manual",
"schedule_value": "0 4 * * *"
}
'import requests
url = "https://v1.api.altostrat.io/workflows/validate"
payload = {
"name": "Daily Network Health Check",
"authorization_id": "auth_01H...",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 150,
"y": 250
},
"data": { "componentId": "manual_trigger" }
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2",
"sourceHandle": "true"
}
],
"description": "<string>",
"is_active": True,
"schedule_type": "manual",
"schedule_value": "0 4 * * *"
}
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({
name: 'Daily Network Health Check',
authorization_id: 'auth_01H...',
nodes: [
{
id: 'n1',
type: 'manual_trigger',
position: {x: 150, y: 250},
data: {componentId: 'manual_trigger'}
}
],
edges: [{id: 'e1-2', source: 'n1', target: 'n2', sourceHandle: 'true'}],
description: '<string>',
is_active: true,
schedule_type: 'manual',
schedule_value: '0 4 * * *'
})
};
fetch('https://v1.api.altostrat.io/workflows/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://v1.api.altostrat.io/workflows/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([
'name' => 'Daily Network Health Check',
'authorization_id' => 'auth_01H...',
'nodes' => [
[
'id' => 'n1',
'type' => 'manual_trigger',
'position' => [
'x' => 150,
'y' => 250
],
'data' => [
'componentId' => 'manual_trigger'
]
]
],
'edges' => [
[
'id' => 'e1-2',
'source' => 'n1',
'target' => 'n2',
'sourceHandle' => 'true'
]
],
'description' => '<string>',
'is_active' => true,
'schedule_type' => 'manual',
'schedule_value' => '0 4 * * *'
]),
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://v1.api.altostrat.io/workflows/validate"
payload := strings.NewReader("{\n \"name\": \"Daily Network Health Check\",\n \"authorization_id\": \"auth_01H...\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 150,\n \"y\": 250\n },\n \"data\": {\n \"componentId\": \"manual_trigger\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\",\n \"sourceHandle\": \"true\"\n }\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"schedule_type\": \"manual\",\n \"schedule_value\": \"0 4 * * *\"\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://v1.api.altostrat.io/workflows/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Daily Network Health Check\",\n \"authorization_id\": \"auth_01H...\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 150,\n \"y\": 250\n },\n \"data\": {\n \"componentId\": \"manual_trigger\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\",\n \"sourceHandle\": \"true\"\n }\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"schedule_type\": \"manual\",\n \"schedule_value\": \"0 4 * * *\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/workflows/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 \"name\": \"Daily Network Health Check\",\n \"authorization_id\": \"auth_01H...\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 150,\n \"y\": 250\n },\n \"data\": {\n \"componentId\": \"manual_trigger\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\",\n \"sourceHandle\": \"true\"\n }\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"schedule_type\": \"manual\",\n \"schedule_value\": \"0 4 * * *\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [
"<string>"
]
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}Authorizations
Standard JWT for user sessions obtained via Altostrat authentication.
Body
application/json
The name for the new workflow.
Example:
"Daily Network Health Check"
The prefixed ID of the Authorization (auth_...) to use for this workflow's executions.
Example:
"auth_01H..."
The array of nodes defining the workflow logic.
Minimum array length:
1Show child attributes
Show child attributes
The array of edges connecting the workflow nodes.
Show child attributes
Show child attributes
An optional description for the workflow.
Set to false to create the workflow in an inactive state.
Available options:
manual, interval, cron, daily, weekly, monthly Required if schedule_type is interval or cron.
Example:
"0 4 * * *"
Was this page helpful?
⌘I