Validate workflow
curl --request POST \
--url http://localhost:5173/api/flowdrop/workflows/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "My AI Workflow",
"nodes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "calculator",
"position": {
"x": 100,
"y": 200
},
"data": {
"label": "Math Calculator",
"config": {
"instanceTitle": "Email Summarizer",
"instanceDescription": "Summarizes incoming emails into 3 bullet points",
"instanceBadge": "LLM",
"nodeType": "simple",
"model": "gpt-4o-mini",
"temperature": 0.7,
"maxTokens": 1000,
"apiKey": "sk-...",
"dynamicInputs": [
{
"name": "extra_data",
"label": "Extra Data",
"dataType": "json",
"required": false
}
],
"dynamicOutputs": [
{
"name": "result",
"label": "Result",
"dataType": "string"
}
],
"branches": [
{
"name": "success",
"label": "Success",
"condition": "status === 200"
},
{
"name": "error",
"label": "Error",
"isDefault": true
}
]
},
"metadata": {
"id": "calculator",
"name": "Calculator",
"description": "Perform mathematical operations on input data",
"category": "processing",
"version": "1.0.0",
"inputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": false,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
}
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
},
"product_name": {
"type": "string"
},
"quantity": {
"type": "integer"
},
"price": {
"type": "number"
}
}
}
}
}
}
}
],
"outputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": false,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
}
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
},
"product_name": {
"type": "string"
},
"quantity": {
"type": "integer"
},
"price": {
"type": "number"
}
}
}
}
}
}
}
],
"supportedTypes": [],
"icon": "mdi:calculator",
"color": "#3b82f6",
"badge": "API",
"portDataType": "trigger",
"tags": [
"math",
"calculation",
"processing"
],
"formats": [
"agentspec"
],
"extensions": {
"ui": {
"hideUnconnectedHandles": true,
"style": {
"opacity": 0.8
}
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": true,
"customField": "value"
}
}
},
"isProcessing": true,
"error": "<string>",
"nodeId": "<string>",
"extensions": {
"ui": {
"hideUnconnectedHandles": true,
"style": {
"opacity": 0.8
}
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": true,
"customField": "value"
}
}
},
"deletable": true
}
],
"edges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceHandle": "<string>",
"targetHandle": "<string>",
"selectable": true,
"deletable": true,
"data": {
"label": "<string>",
"condition": "<string>",
"metadata": {
"sourcePortDataType": "<string>"
},
"isToolConnection": true,
"targetNodeType": "<string>",
"targetCategory": "<string>"
}
}
],
"metadata": {
"schemaVersion": "1.0.0",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"author": "admin",
"tags": [
"ai",
"production"
],
"versionId": "<string>",
"updateNumber": 123,
"format": "flowdrop"
},
"description": "<string>",
"config": {}
}
'import requests
url = "http://localhost:5173/api/flowdrop/workflows/validate"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "My AI Workflow",
"nodes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "calculator",
"position": {
"x": 100,
"y": 200
},
"data": {
"label": "Math Calculator",
"config": {
"instanceTitle": "Email Summarizer",
"instanceDescription": "Summarizes incoming emails into 3 bullet points",
"instanceBadge": "LLM",
"nodeType": "simple",
"model": "gpt-4o-mini",
"temperature": 0.7,
"maxTokens": 1000,
"apiKey": "sk-...",
"dynamicInputs": [
{
"name": "extra_data",
"label": "Extra Data",
"dataType": "json",
"required": False
}
],
"dynamicOutputs": [
{
"name": "result",
"label": "Result",
"dataType": "string"
}
],
"branches": [
{
"name": "success",
"label": "Success",
"condition": "status === 200"
},
{
"name": "error",
"label": "Error",
"isDefault": True
}
]
},
"metadata": {
"id": "calculator",
"name": "Calculator",
"description": "Perform mathematical operations on input data",
"category": "processing",
"version": "1.0.0",
"inputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": False,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" },
"country": { "type": "string" }
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": { "type": "string" },
"product_name": { "type": "string" },
"quantity": { "type": "integer" },
"price": { "type": "number" }
}
}
}
}
}
}
],
"outputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": False,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" },
"country": { "type": "string" }
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": { "type": "string" },
"product_name": { "type": "string" },
"quantity": { "type": "integer" },
"price": { "type": "number" }
}
}
}
}
}
}
],
"supportedTypes": [],
"icon": "mdi:calculator",
"color": "#3b82f6",
"badge": "API",
"portDataType": "trigger",
"tags": ["math", "calculation", "processing"],
"formats": ["agentspec"],
"extensions": {
"ui": {
"hideUnconnectedHandles": True,
"style": { "opacity": 0.8 }
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": True,
"customField": "value"
}
}
},
"isProcessing": True,
"error": "<string>",
"nodeId": "<string>",
"extensions": {
"ui": {
"hideUnconnectedHandles": True,
"style": { "opacity": 0.8 }
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": True,
"customField": "value"
}
}
},
"deletable": True
}
],
"edges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceHandle": "<string>",
"targetHandle": "<string>",
"selectable": True,
"deletable": True,
"data": {
"label": "<string>",
"condition": "<string>",
"metadata": { "sourcePortDataType": "<string>" },
"isToolConnection": True,
"targetNodeType": "<string>",
"targetCategory": "<string>"
}
}
],
"metadata": {
"schemaVersion": "1.0.0",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"author": "admin",
"tags": ["ai", "production"],
"versionId": "<string>",
"updateNumber": 123,
"format": "flowdrop"
},
"description": "<string>",
"config": {}
}
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({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'My AI Workflow',
nodes: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'calculator',
position: {x: 100, y: 200},
data: {
label: 'Math Calculator',
config: {
instanceTitle: 'Email Summarizer',
instanceDescription: 'Summarizes incoming emails into 3 bullet points',
instanceBadge: 'LLM',
nodeType: 'simple',
model: 'gpt-4o-mini',
temperature: 0.7,
maxTokens: 1000,
apiKey: 'sk-...',
dynamicInputs: [{name: 'extra_data', label: 'Extra Data', dataType: 'json', required: false}],
dynamicOutputs: [{name: 'result', label: 'Result', dataType: 'string'}],
branches: [
{name: 'success', label: 'Success', condition: 'status === 200'},
{name: 'error', label: 'Error', isDefault: true}
]
},
metadata: {
id: 'calculator',
name: 'Calculator',
description: 'Perform mathematical operations on input data',
category: 'processing',
version: '1.0.0',
inputs: [
{
id: 'json',
name: 'JSON Response',
dataType: 'mixed',
required: false,
description: 'Parsed JSON response from the HTTP request',
defaultValue: '<unknown>',
schema: {
type: 'object',
properties: {
user: {
type: 'object',
title: 'User',
description: 'User information',
properties: {
id: {type: 'integer', description: 'User ID'},
name: {type: 'string', description: 'User full name'},
email: {type: 'string', description: 'User email address'},
address: {
type: 'object',
title: 'Address',
properties: {street: {type: 'string'}, city: {type: 'string'}, country: {type: 'string'}}
}
}
},
orders: {
type: 'array',
title: 'Orders',
description: 'List of user orders',
items: {
type: 'object',
properties: {
order_id: {type: 'string'},
product_name: {type: 'string'},
quantity: {type: 'integer'},
price: {type: 'number'}
}
}
}
}
}
}
],
outputs: [
{
id: 'json',
name: 'JSON Response',
dataType: 'mixed',
required: false,
description: 'Parsed JSON response from the HTTP request',
defaultValue: '<unknown>',
schema: {
type: 'object',
properties: {
user: {
type: 'object',
title: 'User',
description: 'User information',
properties: {
id: {type: 'integer', description: 'User ID'},
name: {type: 'string', description: 'User full name'},
email: {type: 'string', description: 'User email address'},
address: {
type: 'object',
title: 'Address',
properties: {street: {type: 'string'}, city: {type: 'string'}, country: {type: 'string'}}
}
}
},
orders: {
type: 'array',
title: 'Orders',
description: 'List of user orders',
items: {
type: 'object',
properties: {
order_id: {type: 'string'},
product_name: {type: 'string'},
quantity: {type: 'integer'},
price: {type: 'number'}
}
}
}
}
}
}
],
supportedTypes: [],
icon: 'mdi:calculator',
color: '#3b82f6',
badge: 'API',
portDataType: 'trigger',
tags: ['math', 'calculation', 'processing'],
formats: ['agentspec'],
extensions: {
ui: {hideUnconnectedHandles: true, style: {opacity: 0.8}},
'agentspec:component_type': 'llm_node',
'myapp:analytics': {trackUsage: true, customField: 'value'}
}
},
isProcessing: true,
error: '<string>',
nodeId: '<string>',
extensions: {
ui: {hideUnconnectedHandles: true, style: {opacity: 0.8}},
'agentspec:component_type': 'llm_node',
'myapp:analytics': {trackUsage: true, customField: 'value'}
}
},
deletable: true
}
],
edges: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
target: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sourceHandle: '<string>',
targetHandle: '<string>',
selectable: true,
deletable: true,
data: {
label: '<string>',
condition: '<string>',
metadata: {sourcePortDataType: '<string>'},
isToolConnection: true,
targetNodeType: '<string>',
targetCategory: '<string>'
}
}
],
metadata: {
schemaVersion: '1.0.0',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
author: 'admin',
tags: ['ai', 'production'],
versionId: '<string>',
updateNumber: 123,
format: 'flowdrop'
},
description: '<string>',
config: {}
})
};
fetch('http://localhost:5173/api/flowdrop/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_PORT => "5173",
CURLOPT_URL => "http://localhost:5173/api/flowdrop/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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'My AI Workflow',
'nodes' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'calculator',
'position' => [
'x' => 100,
'y' => 200
],
'data' => [
'label' => 'Math Calculator',
'config' => [
'instanceTitle' => 'Email Summarizer',
'instanceDescription' => 'Summarizes incoming emails into 3 bullet points',
'instanceBadge' => 'LLM',
'nodeType' => 'simple',
'model' => 'gpt-4o-mini',
'temperature' => 0.7,
'maxTokens' => 1000,
'apiKey' => 'sk-...',
'dynamicInputs' => [
[
'name' => 'extra_data',
'label' => 'Extra Data',
'dataType' => 'json',
'required' => false
]
],
'dynamicOutputs' => [
[
'name' => 'result',
'label' => 'Result',
'dataType' => 'string'
]
],
'branches' => [
[
'name' => 'success',
'label' => 'Success',
'condition' => 'status === 200'
],
[
'name' => 'error',
'label' => 'Error',
'isDefault' => true
]
]
],
'metadata' => [
'id' => 'calculator',
'name' => 'Calculator',
'description' => 'Perform mathematical operations on input data',
'category' => 'processing',
'version' => '1.0.0',
'inputs' => [
[
'id' => 'json',
'name' => 'JSON Response',
'dataType' => 'mixed',
'required' => false,
'description' => 'Parsed JSON response from the HTTP request',
'defaultValue' => '<unknown>',
'schema' => [
'type' => 'object',
'properties' => [
'user' => [
'type' => 'object',
'title' => 'User',
'description' => 'User information',
'properties' => [
'id' => [
'type' => 'integer',
'description' => 'User ID'
],
'name' => [
'type' => 'string',
'description' => 'User full name'
],
'email' => [
'type' => 'string',
'description' => 'User email address'
],
'address' => [
'type' => 'object',
'title' => 'Address',
'properties' => [
'street' => [
'type' => 'string'
],
'city' => [
'type' => 'string'
],
'country' => [
'type' => 'string'
]
]
]
]
],
'orders' => [
'type' => 'array',
'title' => 'Orders',
'description' => 'List of user orders',
'items' => [
'type' => 'object',
'properties' => [
'order_id' => [
'type' => 'string'
],
'product_name' => [
'type' => 'string'
],
'quantity' => [
'type' => 'integer'
],
'price' => [
'type' => 'number'
]
]
]
]
]
]
]
],
'outputs' => [
[
'id' => 'json',
'name' => 'JSON Response',
'dataType' => 'mixed',
'required' => false,
'description' => 'Parsed JSON response from the HTTP request',
'defaultValue' => '<unknown>',
'schema' => [
'type' => 'object',
'properties' => [
'user' => [
'type' => 'object',
'title' => 'User',
'description' => 'User information',
'properties' => [
'id' => [
'type' => 'integer',
'description' => 'User ID'
],
'name' => [
'type' => 'string',
'description' => 'User full name'
],
'email' => [
'type' => 'string',
'description' => 'User email address'
],
'address' => [
'type' => 'object',
'title' => 'Address',
'properties' => [
'street' => [
'type' => 'string'
],
'city' => [
'type' => 'string'
],
'country' => [
'type' => 'string'
]
]
]
]
],
'orders' => [
'type' => 'array',
'title' => 'Orders',
'description' => 'List of user orders',
'items' => [
'type' => 'object',
'properties' => [
'order_id' => [
'type' => 'string'
],
'product_name' => [
'type' => 'string'
],
'quantity' => [
'type' => 'integer'
],
'price' => [
'type' => 'number'
]
]
]
]
]
]
]
],
'supportedTypes' => [
],
'icon' => 'mdi:calculator',
'color' => '#3b82f6',
'badge' => 'API',
'portDataType' => 'trigger',
'tags' => [
'math',
'calculation',
'processing'
],
'formats' => [
'agentspec'
],
'extensions' => [
'ui' => [
'hideUnconnectedHandles' => true,
'style' => [
'opacity' => 0.8
]
],
'agentspec:component_type' => 'llm_node',
'myapp:analytics' => [
'trackUsage' => true,
'customField' => 'value'
]
]
],
'isProcessing' => true,
'error' => '<string>',
'nodeId' => '<string>',
'extensions' => [
'ui' => [
'hideUnconnectedHandles' => true,
'style' => [
'opacity' => 0.8
]
],
'agentspec:component_type' => 'llm_node',
'myapp:analytics' => [
'trackUsage' => true,
'customField' => 'value'
]
]
],
'deletable' => true
]
],
'edges' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'target' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sourceHandle' => '<string>',
'targetHandle' => '<string>',
'selectable' => true,
'deletable' => true,
'data' => [
'label' => '<string>',
'condition' => '<string>',
'metadata' => [
'sourcePortDataType' => '<string>'
],
'isToolConnection' => true,
'targetNodeType' => '<string>',
'targetCategory' => '<string>'
]
]
],
'metadata' => [
'schemaVersion' => '1.0.0',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'author' => 'admin',
'tags' => [
'ai',
'production'
],
'versionId' => '<string>',
'updateNumber' => 123,
'format' => 'flowdrop'
],
'description' => '<string>',
'config' => [
]
]),
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:5173/api/flowdrop/workflows/validate"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"My AI Workflow\",\n \"nodes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"calculator\",\n \"position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"data\": {\n \"label\": \"Math Calculator\",\n \"config\": {\n \"instanceTitle\": \"Email Summarizer\",\n \"instanceDescription\": \"Summarizes incoming emails into 3 bullet points\",\n \"instanceBadge\": \"LLM\",\n \"nodeType\": \"simple\",\n \"model\": \"gpt-4o-mini\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"apiKey\": \"sk-...\",\n \"dynamicInputs\": [\n {\n \"name\": \"extra_data\",\n \"label\": \"Extra Data\",\n \"dataType\": \"json\",\n \"required\": false\n }\n ],\n \"dynamicOutputs\": [\n {\n \"name\": \"result\",\n \"label\": \"Result\",\n \"dataType\": \"string\"\n }\n ],\n \"branches\": [\n {\n \"name\": \"success\",\n \"label\": \"Success\",\n \"condition\": \"status === 200\"\n },\n {\n \"name\": \"error\",\n \"label\": \"Error\",\n \"isDefault\": true\n }\n ]\n },\n \"metadata\": {\n \"id\": \"calculator\",\n \"name\": \"Calculator\",\n \"description\": \"Perform mathematical operations on input data\",\n \"category\": \"processing\",\n \"version\": \"1.0.0\",\n \"inputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"outputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"supportedTypes\": [],\n \"icon\": \"mdi:calculator\",\n \"color\": \"#3b82f6\",\n \"badge\": \"API\",\n \"portDataType\": \"trigger\",\n \"tags\": [\n \"math\",\n \"calculation\",\n \"processing\"\n ],\n \"formats\": [\n \"agentspec\"\n ],\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"isProcessing\": true,\n \"error\": \"<string>\",\n \"nodeId\": \"<string>\",\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"deletable\": true\n }\n ],\n \"edges\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\",\n \"selectable\": true,\n \"deletable\": true,\n \"data\": {\n \"label\": \"<string>\",\n \"condition\": \"<string>\",\n \"metadata\": {\n \"sourcePortDataType\": \"<string>\"\n },\n \"isToolConnection\": true,\n \"targetNodeType\": \"<string>\",\n \"targetCategory\": \"<string>\"\n }\n }\n ],\n \"metadata\": {\n \"schemaVersion\": \"1.0.0\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"author\": \"admin\",\n \"tags\": [\n \"ai\",\n \"production\"\n ],\n \"versionId\": \"<string>\",\n \"updateNumber\": 123,\n \"format\": \"flowdrop\"\n },\n \"description\": \"<string>\",\n \"config\": {}\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:5173/api/flowdrop/workflows/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"My AI Workflow\",\n \"nodes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"calculator\",\n \"position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"data\": {\n \"label\": \"Math Calculator\",\n \"config\": {\n \"instanceTitle\": \"Email Summarizer\",\n \"instanceDescription\": \"Summarizes incoming emails into 3 bullet points\",\n \"instanceBadge\": \"LLM\",\n \"nodeType\": \"simple\",\n \"model\": \"gpt-4o-mini\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"apiKey\": \"sk-...\",\n \"dynamicInputs\": [\n {\n \"name\": \"extra_data\",\n \"label\": \"Extra Data\",\n \"dataType\": \"json\",\n \"required\": false\n }\n ],\n \"dynamicOutputs\": [\n {\n \"name\": \"result\",\n \"label\": \"Result\",\n \"dataType\": \"string\"\n }\n ],\n \"branches\": [\n {\n \"name\": \"success\",\n \"label\": \"Success\",\n \"condition\": \"status === 200\"\n },\n {\n \"name\": \"error\",\n \"label\": \"Error\",\n \"isDefault\": true\n }\n ]\n },\n \"metadata\": {\n \"id\": \"calculator\",\n \"name\": \"Calculator\",\n \"description\": \"Perform mathematical operations on input data\",\n \"category\": \"processing\",\n \"version\": \"1.0.0\",\n \"inputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"outputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"supportedTypes\": [],\n \"icon\": \"mdi:calculator\",\n \"color\": \"#3b82f6\",\n \"badge\": \"API\",\n \"portDataType\": \"trigger\",\n \"tags\": [\n \"math\",\n \"calculation\",\n \"processing\"\n ],\n \"formats\": [\n \"agentspec\"\n ],\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"isProcessing\": true,\n \"error\": \"<string>\",\n \"nodeId\": \"<string>\",\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"deletable\": true\n }\n ],\n \"edges\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\",\n \"selectable\": true,\n \"deletable\": true,\n \"data\": {\n \"label\": \"<string>\",\n \"condition\": \"<string>\",\n \"metadata\": {\n \"sourcePortDataType\": \"<string>\"\n },\n \"isToolConnection\": true,\n \"targetNodeType\": \"<string>\",\n \"targetCategory\": \"<string>\"\n }\n }\n ],\n \"metadata\": {\n \"schemaVersion\": \"1.0.0\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"author\": \"admin\",\n \"tags\": [\n \"ai\",\n \"production\"\n ],\n \"versionId\": \"<string>\",\n \"updateNumber\": 123,\n \"format\": \"flowdrop\"\n },\n \"description\": \"<string>\",\n \"config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5173/api/flowdrop/workflows/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 \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"My AI Workflow\",\n \"nodes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"calculator\",\n \"position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"data\": {\n \"label\": \"Math Calculator\",\n \"config\": {\n \"instanceTitle\": \"Email Summarizer\",\n \"instanceDescription\": \"Summarizes incoming emails into 3 bullet points\",\n \"instanceBadge\": \"LLM\",\n \"nodeType\": \"simple\",\n \"model\": \"gpt-4o-mini\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"apiKey\": \"sk-...\",\n \"dynamicInputs\": [\n {\n \"name\": \"extra_data\",\n \"label\": \"Extra Data\",\n \"dataType\": \"json\",\n \"required\": false\n }\n ],\n \"dynamicOutputs\": [\n {\n \"name\": \"result\",\n \"label\": \"Result\",\n \"dataType\": \"string\"\n }\n ],\n \"branches\": [\n {\n \"name\": \"success\",\n \"label\": \"Success\",\n \"condition\": \"status === 200\"\n },\n {\n \"name\": \"error\",\n \"label\": \"Error\",\n \"isDefault\": true\n }\n ]\n },\n \"metadata\": {\n \"id\": \"calculator\",\n \"name\": \"Calculator\",\n \"description\": \"Perform mathematical operations on input data\",\n \"category\": \"processing\",\n \"version\": \"1.0.0\",\n \"inputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"outputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"supportedTypes\": [],\n \"icon\": \"mdi:calculator\",\n \"color\": \"#3b82f6\",\n \"badge\": \"API\",\n \"portDataType\": \"trigger\",\n \"tags\": [\n \"math\",\n \"calculation\",\n \"processing\"\n ],\n \"formats\": [\n \"agentspec\"\n ],\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"isProcessing\": true,\n \"error\": \"<string>\",\n \"nodeId\": \"<string>\",\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"deletable\": true\n }\n ],\n \"edges\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\",\n \"selectable\": true,\n \"deletable\": true,\n \"data\": {\n \"label\": \"<string>\",\n \"condition\": \"<string>\",\n \"metadata\": {\n \"sourcePortDataType\": \"<string>\"\n },\n \"isToolConnection\": true,\n \"targetNodeType\": \"<string>\",\n \"targetCategory\": \"<string>\"\n }\n }\n ],\n \"metadata\": {\n \"schemaVersion\": \"1.0.0\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"author\": \"admin\",\n \"tags\": [\n \"ai\",\n \"production\"\n ],\n \"versionId\": \"<string>\",\n \"updateNumber\": 123,\n \"format\": \"flowdrop\"\n },\n \"description\": \"<string>\",\n \"config\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"valid": true,
"errors": [
"<string>"
],
"warnings": [
"<string>"
],
"suggestions": [
"<string>"
]
},
"message": "<string>",
"error": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "VALIDATION_ERROR",
"details": {
"field": "name",
"message": "Name is required"
}
}{
"success": false,
"error": "Internal server error",
"code": "INTERNAL_ERROR"
}Validation
Validate workflow
Validate a workflow structure without saving it. Checks for:
- Valid node connections and port compatibility
- Required configuration fields
- Circular dependencies
- Orphaned nodes
- Missing required inputs
POST
/
workflows
/
validate
Validate workflow
curl --request POST \
--url http://localhost:5173/api/flowdrop/workflows/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "My AI Workflow",
"nodes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "calculator",
"position": {
"x": 100,
"y": 200
},
"data": {
"label": "Math Calculator",
"config": {
"instanceTitle": "Email Summarizer",
"instanceDescription": "Summarizes incoming emails into 3 bullet points",
"instanceBadge": "LLM",
"nodeType": "simple",
"model": "gpt-4o-mini",
"temperature": 0.7,
"maxTokens": 1000,
"apiKey": "sk-...",
"dynamicInputs": [
{
"name": "extra_data",
"label": "Extra Data",
"dataType": "json",
"required": false
}
],
"dynamicOutputs": [
{
"name": "result",
"label": "Result",
"dataType": "string"
}
],
"branches": [
{
"name": "success",
"label": "Success",
"condition": "status === 200"
},
{
"name": "error",
"label": "Error",
"isDefault": true
}
]
},
"metadata": {
"id": "calculator",
"name": "Calculator",
"description": "Perform mathematical operations on input data",
"category": "processing",
"version": "1.0.0",
"inputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": false,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
}
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
},
"product_name": {
"type": "string"
},
"quantity": {
"type": "integer"
},
"price": {
"type": "number"
}
}
}
}
}
}
}
],
"outputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": false,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
}
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
},
"product_name": {
"type": "string"
},
"quantity": {
"type": "integer"
},
"price": {
"type": "number"
}
}
}
}
}
}
}
],
"supportedTypes": [],
"icon": "mdi:calculator",
"color": "#3b82f6",
"badge": "API",
"portDataType": "trigger",
"tags": [
"math",
"calculation",
"processing"
],
"formats": [
"agentspec"
],
"extensions": {
"ui": {
"hideUnconnectedHandles": true,
"style": {
"opacity": 0.8
}
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": true,
"customField": "value"
}
}
},
"isProcessing": true,
"error": "<string>",
"nodeId": "<string>",
"extensions": {
"ui": {
"hideUnconnectedHandles": true,
"style": {
"opacity": 0.8
}
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": true,
"customField": "value"
}
}
},
"deletable": true
}
],
"edges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceHandle": "<string>",
"targetHandle": "<string>",
"selectable": true,
"deletable": true,
"data": {
"label": "<string>",
"condition": "<string>",
"metadata": {
"sourcePortDataType": "<string>"
},
"isToolConnection": true,
"targetNodeType": "<string>",
"targetCategory": "<string>"
}
}
],
"metadata": {
"schemaVersion": "1.0.0",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"author": "admin",
"tags": [
"ai",
"production"
],
"versionId": "<string>",
"updateNumber": 123,
"format": "flowdrop"
},
"description": "<string>",
"config": {}
}
'import requests
url = "http://localhost:5173/api/flowdrop/workflows/validate"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "My AI Workflow",
"nodes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "calculator",
"position": {
"x": 100,
"y": 200
},
"data": {
"label": "Math Calculator",
"config": {
"instanceTitle": "Email Summarizer",
"instanceDescription": "Summarizes incoming emails into 3 bullet points",
"instanceBadge": "LLM",
"nodeType": "simple",
"model": "gpt-4o-mini",
"temperature": 0.7,
"maxTokens": 1000,
"apiKey": "sk-...",
"dynamicInputs": [
{
"name": "extra_data",
"label": "Extra Data",
"dataType": "json",
"required": False
}
],
"dynamicOutputs": [
{
"name": "result",
"label": "Result",
"dataType": "string"
}
],
"branches": [
{
"name": "success",
"label": "Success",
"condition": "status === 200"
},
{
"name": "error",
"label": "Error",
"isDefault": True
}
]
},
"metadata": {
"id": "calculator",
"name": "Calculator",
"description": "Perform mathematical operations on input data",
"category": "processing",
"version": "1.0.0",
"inputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": False,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" },
"country": { "type": "string" }
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": { "type": "string" },
"product_name": { "type": "string" },
"quantity": { "type": "integer" },
"price": { "type": "number" }
}
}
}
}
}
}
],
"outputs": [
{
"id": "json",
"name": "JSON Response",
"dataType": "mixed",
"required": False,
"description": "Parsed JSON response from the HTTP request",
"defaultValue": "<unknown>",
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"title": "User",
"description": "User information",
"properties": {
"id": {
"type": "integer",
"description": "User ID"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email address"
},
"address": {
"type": "object",
"title": "Address",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" },
"country": { "type": "string" }
}
}
}
},
"orders": {
"type": "array",
"title": "Orders",
"description": "List of user orders",
"items": {
"type": "object",
"properties": {
"order_id": { "type": "string" },
"product_name": { "type": "string" },
"quantity": { "type": "integer" },
"price": { "type": "number" }
}
}
}
}
}
}
],
"supportedTypes": [],
"icon": "mdi:calculator",
"color": "#3b82f6",
"badge": "API",
"portDataType": "trigger",
"tags": ["math", "calculation", "processing"],
"formats": ["agentspec"],
"extensions": {
"ui": {
"hideUnconnectedHandles": True,
"style": { "opacity": 0.8 }
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": True,
"customField": "value"
}
}
},
"isProcessing": True,
"error": "<string>",
"nodeId": "<string>",
"extensions": {
"ui": {
"hideUnconnectedHandles": True,
"style": { "opacity": 0.8 }
},
"agentspec:component_type": "llm_node",
"myapp:analytics": {
"trackUsage": True,
"customField": "value"
}
}
},
"deletable": True
}
],
"edges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceHandle": "<string>",
"targetHandle": "<string>",
"selectable": True,
"deletable": True,
"data": {
"label": "<string>",
"condition": "<string>",
"metadata": { "sourcePortDataType": "<string>" },
"isToolConnection": True,
"targetNodeType": "<string>",
"targetCategory": "<string>"
}
}
],
"metadata": {
"schemaVersion": "1.0.0",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"author": "admin",
"tags": ["ai", "production"],
"versionId": "<string>",
"updateNumber": 123,
"format": "flowdrop"
},
"description": "<string>",
"config": {}
}
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({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'My AI Workflow',
nodes: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'calculator',
position: {x: 100, y: 200},
data: {
label: 'Math Calculator',
config: {
instanceTitle: 'Email Summarizer',
instanceDescription: 'Summarizes incoming emails into 3 bullet points',
instanceBadge: 'LLM',
nodeType: 'simple',
model: 'gpt-4o-mini',
temperature: 0.7,
maxTokens: 1000,
apiKey: 'sk-...',
dynamicInputs: [{name: 'extra_data', label: 'Extra Data', dataType: 'json', required: false}],
dynamicOutputs: [{name: 'result', label: 'Result', dataType: 'string'}],
branches: [
{name: 'success', label: 'Success', condition: 'status === 200'},
{name: 'error', label: 'Error', isDefault: true}
]
},
metadata: {
id: 'calculator',
name: 'Calculator',
description: 'Perform mathematical operations on input data',
category: 'processing',
version: '1.0.0',
inputs: [
{
id: 'json',
name: 'JSON Response',
dataType: 'mixed',
required: false,
description: 'Parsed JSON response from the HTTP request',
defaultValue: '<unknown>',
schema: {
type: 'object',
properties: {
user: {
type: 'object',
title: 'User',
description: 'User information',
properties: {
id: {type: 'integer', description: 'User ID'},
name: {type: 'string', description: 'User full name'},
email: {type: 'string', description: 'User email address'},
address: {
type: 'object',
title: 'Address',
properties: {street: {type: 'string'}, city: {type: 'string'}, country: {type: 'string'}}
}
}
},
orders: {
type: 'array',
title: 'Orders',
description: 'List of user orders',
items: {
type: 'object',
properties: {
order_id: {type: 'string'},
product_name: {type: 'string'},
quantity: {type: 'integer'},
price: {type: 'number'}
}
}
}
}
}
}
],
outputs: [
{
id: 'json',
name: 'JSON Response',
dataType: 'mixed',
required: false,
description: 'Parsed JSON response from the HTTP request',
defaultValue: '<unknown>',
schema: {
type: 'object',
properties: {
user: {
type: 'object',
title: 'User',
description: 'User information',
properties: {
id: {type: 'integer', description: 'User ID'},
name: {type: 'string', description: 'User full name'},
email: {type: 'string', description: 'User email address'},
address: {
type: 'object',
title: 'Address',
properties: {street: {type: 'string'}, city: {type: 'string'}, country: {type: 'string'}}
}
}
},
orders: {
type: 'array',
title: 'Orders',
description: 'List of user orders',
items: {
type: 'object',
properties: {
order_id: {type: 'string'},
product_name: {type: 'string'},
quantity: {type: 'integer'},
price: {type: 'number'}
}
}
}
}
}
}
],
supportedTypes: [],
icon: 'mdi:calculator',
color: '#3b82f6',
badge: 'API',
portDataType: 'trigger',
tags: ['math', 'calculation', 'processing'],
formats: ['agentspec'],
extensions: {
ui: {hideUnconnectedHandles: true, style: {opacity: 0.8}},
'agentspec:component_type': 'llm_node',
'myapp:analytics': {trackUsage: true, customField: 'value'}
}
},
isProcessing: true,
error: '<string>',
nodeId: '<string>',
extensions: {
ui: {hideUnconnectedHandles: true, style: {opacity: 0.8}},
'agentspec:component_type': 'llm_node',
'myapp:analytics': {trackUsage: true, customField: 'value'}
}
},
deletable: true
}
],
edges: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
target: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sourceHandle: '<string>',
targetHandle: '<string>',
selectable: true,
deletable: true,
data: {
label: '<string>',
condition: '<string>',
metadata: {sourcePortDataType: '<string>'},
isToolConnection: true,
targetNodeType: '<string>',
targetCategory: '<string>'
}
}
],
metadata: {
schemaVersion: '1.0.0',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
author: 'admin',
tags: ['ai', 'production'],
versionId: '<string>',
updateNumber: 123,
format: 'flowdrop'
},
description: '<string>',
config: {}
})
};
fetch('http://localhost:5173/api/flowdrop/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_PORT => "5173",
CURLOPT_URL => "http://localhost:5173/api/flowdrop/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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'My AI Workflow',
'nodes' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'calculator',
'position' => [
'x' => 100,
'y' => 200
],
'data' => [
'label' => 'Math Calculator',
'config' => [
'instanceTitle' => 'Email Summarizer',
'instanceDescription' => 'Summarizes incoming emails into 3 bullet points',
'instanceBadge' => 'LLM',
'nodeType' => 'simple',
'model' => 'gpt-4o-mini',
'temperature' => 0.7,
'maxTokens' => 1000,
'apiKey' => 'sk-...',
'dynamicInputs' => [
[
'name' => 'extra_data',
'label' => 'Extra Data',
'dataType' => 'json',
'required' => false
]
],
'dynamicOutputs' => [
[
'name' => 'result',
'label' => 'Result',
'dataType' => 'string'
]
],
'branches' => [
[
'name' => 'success',
'label' => 'Success',
'condition' => 'status === 200'
],
[
'name' => 'error',
'label' => 'Error',
'isDefault' => true
]
]
],
'metadata' => [
'id' => 'calculator',
'name' => 'Calculator',
'description' => 'Perform mathematical operations on input data',
'category' => 'processing',
'version' => '1.0.0',
'inputs' => [
[
'id' => 'json',
'name' => 'JSON Response',
'dataType' => 'mixed',
'required' => false,
'description' => 'Parsed JSON response from the HTTP request',
'defaultValue' => '<unknown>',
'schema' => [
'type' => 'object',
'properties' => [
'user' => [
'type' => 'object',
'title' => 'User',
'description' => 'User information',
'properties' => [
'id' => [
'type' => 'integer',
'description' => 'User ID'
],
'name' => [
'type' => 'string',
'description' => 'User full name'
],
'email' => [
'type' => 'string',
'description' => 'User email address'
],
'address' => [
'type' => 'object',
'title' => 'Address',
'properties' => [
'street' => [
'type' => 'string'
],
'city' => [
'type' => 'string'
],
'country' => [
'type' => 'string'
]
]
]
]
],
'orders' => [
'type' => 'array',
'title' => 'Orders',
'description' => 'List of user orders',
'items' => [
'type' => 'object',
'properties' => [
'order_id' => [
'type' => 'string'
],
'product_name' => [
'type' => 'string'
],
'quantity' => [
'type' => 'integer'
],
'price' => [
'type' => 'number'
]
]
]
]
]
]
]
],
'outputs' => [
[
'id' => 'json',
'name' => 'JSON Response',
'dataType' => 'mixed',
'required' => false,
'description' => 'Parsed JSON response from the HTTP request',
'defaultValue' => '<unknown>',
'schema' => [
'type' => 'object',
'properties' => [
'user' => [
'type' => 'object',
'title' => 'User',
'description' => 'User information',
'properties' => [
'id' => [
'type' => 'integer',
'description' => 'User ID'
],
'name' => [
'type' => 'string',
'description' => 'User full name'
],
'email' => [
'type' => 'string',
'description' => 'User email address'
],
'address' => [
'type' => 'object',
'title' => 'Address',
'properties' => [
'street' => [
'type' => 'string'
],
'city' => [
'type' => 'string'
],
'country' => [
'type' => 'string'
]
]
]
]
],
'orders' => [
'type' => 'array',
'title' => 'Orders',
'description' => 'List of user orders',
'items' => [
'type' => 'object',
'properties' => [
'order_id' => [
'type' => 'string'
],
'product_name' => [
'type' => 'string'
],
'quantity' => [
'type' => 'integer'
],
'price' => [
'type' => 'number'
]
]
]
]
]
]
]
],
'supportedTypes' => [
],
'icon' => 'mdi:calculator',
'color' => '#3b82f6',
'badge' => 'API',
'portDataType' => 'trigger',
'tags' => [
'math',
'calculation',
'processing'
],
'formats' => [
'agentspec'
],
'extensions' => [
'ui' => [
'hideUnconnectedHandles' => true,
'style' => [
'opacity' => 0.8
]
],
'agentspec:component_type' => 'llm_node',
'myapp:analytics' => [
'trackUsage' => true,
'customField' => 'value'
]
]
],
'isProcessing' => true,
'error' => '<string>',
'nodeId' => '<string>',
'extensions' => [
'ui' => [
'hideUnconnectedHandles' => true,
'style' => [
'opacity' => 0.8
]
],
'agentspec:component_type' => 'llm_node',
'myapp:analytics' => [
'trackUsage' => true,
'customField' => 'value'
]
]
],
'deletable' => true
]
],
'edges' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'target' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sourceHandle' => '<string>',
'targetHandle' => '<string>',
'selectable' => true,
'deletable' => true,
'data' => [
'label' => '<string>',
'condition' => '<string>',
'metadata' => [
'sourcePortDataType' => '<string>'
],
'isToolConnection' => true,
'targetNodeType' => '<string>',
'targetCategory' => '<string>'
]
]
],
'metadata' => [
'schemaVersion' => '1.0.0',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'author' => 'admin',
'tags' => [
'ai',
'production'
],
'versionId' => '<string>',
'updateNumber' => 123,
'format' => 'flowdrop'
],
'description' => '<string>',
'config' => [
]
]),
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:5173/api/flowdrop/workflows/validate"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"My AI Workflow\",\n \"nodes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"calculator\",\n \"position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"data\": {\n \"label\": \"Math Calculator\",\n \"config\": {\n \"instanceTitle\": \"Email Summarizer\",\n \"instanceDescription\": \"Summarizes incoming emails into 3 bullet points\",\n \"instanceBadge\": \"LLM\",\n \"nodeType\": \"simple\",\n \"model\": \"gpt-4o-mini\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"apiKey\": \"sk-...\",\n \"dynamicInputs\": [\n {\n \"name\": \"extra_data\",\n \"label\": \"Extra Data\",\n \"dataType\": \"json\",\n \"required\": false\n }\n ],\n \"dynamicOutputs\": [\n {\n \"name\": \"result\",\n \"label\": \"Result\",\n \"dataType\": \"string\"\n }\n ],\n \"branches\": [\n {\n \"name\": \"success\",\n \"label\": \"Success\",\n \"condition\": \"status === 200\"\n },\n {\n \"name\": \"error\",\n \"label\": \"Error\",\n \"isDefault\": true\n }\n ]\n },\n \"metadata\": {\n \"id\": \"calculator\",\n \"name\": \"Calculator\",\n \"description\": \"Perform mathematical operations on input data\",\n \"category\": \"processing\",\n \"version\": \"1.0.0\",\n \"inputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"outputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"supportedTypes\": [],\n \"icon\": \"mdi:calculator\",\n \"color\": \"#3b82f6\",\n \"badge\": \"API\",\n \"portDataType\": \"trigger\",\n \"tags\": [\n \"math\",\n \"calculation\",\n \"processing\"\n ],\n \"formats\": [\n \"agentspec\"\n ],\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"isProcessing\": true,\n \"error\": \"<string>\",\n \"nodeId\": \"<string>\",\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"deletable\": true\n }\n ],\n \"edges\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\",\n \"selectable\": true,\n \"deletable\": true,\n \"data\": {\n \"label\": \"<string>\",\n \"condition\": \"<string>\",\n \"metadata\": {\n \"sourcePortDataType\": \"<string>\"\n },\n \"isToolConnection\": true,\n \"targetNodeType\": \"<string>\",\n \"targetCategory\": \"<string>\"\n }\n }\n ],\n \"metadata\": {\n \"schemaVersion\": \"1.0.0\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"author\": \"admin\",\n \"tags\": [\n \"ai\",\n \"production\"\n ],\n \"versionId\": \"<string>\",\n \"updateNumber\": 123,\n \"format\": \"flowdrop\"\n },\n \"description\": \"<string>\",\n \"config\": {}\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:5173/api/flowdrop/workflows/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"My AI Workflow\",\n \"nodes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"calculator\",\n \"position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"data\": {\n \"label\": \"Math Calculator\",\n \"config\": {\n \"instanceTitle\": \"Email Summarizer\",\n \"instanceDescription\": \"Summarizes incoming emails into 3 bullet points\",\n \"instanceBadge\": \"LLM\",\n \"nodeType\": \"simple\",\n \"model\": \"gpt-4o-mini\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"apiKey\": \"sk-...\",\n \"dynamicInputs\": [\n {\n \"name\": \"extra_data\",\n \"label\": \"Extra Data\",\n \"dataType\": \"json\",\n \"required\": false\n }\n ],\n \"dynamicOutputs\": [\n {\n \"name\": \"result\",\n \"label\": \"Result\",\n \"dataType\": \"string\"\n }\n ],\n \"branches\": [\n {\n \"name\": \"success\",\n \"label\": \"Success\",\n \"condition\": \"status === 200\"\n },\n {\n \"name\": \"error\",\n \"label\": \"Error\",\n \"isDefault\": true\n }\n ]\n },\n \"metadata\": {\n \"id\": \"calculator\",\n \"name\": \"Calculator\",\n \"description\": \"Perform mathematical operations on input data\",\n \"category\": \"processing\",\n \"version\": \"1.0.0\",\n \"inputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"outputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"supportedTypes\": [],\n \"icon\": \"mdi:calculator\",\n \"color\": \"#3b82f6\",\n \"badge\": \"API\",\n \"portDataType\": \"trigger\",\n \"tags\": [\n \"math\",\n \"calculation\",\n \"processing\"\n ],\n \"formats\": [\n \"agentspec\"\n ],\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"isProcessing\": true,\n \"error\": \"<string>\",\n \"nodeId\": \"<string>\",\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"deletable\": true\n }\n ],\n \"edges\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\",\n \"selectable\": true,\n \"deletable\": true,\n \"data\": {\n \"label\": \"<string>\",\n \"condition\": \"<string>\",\n \"metadata\": {\n \"sourcePortDataType\": \"<string>\"\n },\n \"isToolConnection\": true,\n \"targetNodeType\": \"<string>\",\n \"targetCategory\": \"<string>\"\n }\n }\n ],\n \"metadata\": {\n \"schemaVersion\": \"1.0.0\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"author\": \"admin\",\n \"tags\": [\n \"ai\",\n \"production\"\n ],\n \"versionId\": \"<string>\",\n \"updateNumber\": 123,\n \"format\": \"flowdrop\"\n },\n \"description\": \"<string>\",\n \"config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5173/api/flowdrop/workflows/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 \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"My AI Workflow\",\n \"nodes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"calculator\",\n \"position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"data\": {\n \"label\": \"Math Calculator\",\n \"config\": {\n \"instanceTitle\": \"Email Summarizer\",\n \"instanceDescription\": \"Summarizes incoming emails into 3 bullet points\",\n \"instanceBadge\": \"LLM\",\n \"nodeType\": \"simple\",\n \"model\": \"gpt-4o-mini\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"apiKey\": \"sk-...\",\n \"dynamicInputs\": [\n {\n \"name\": \"extra_data\",\n \"label\": \"Extra Data\",\n \"dataType\": \"json\",\n \"required\": false\n }\n ],\n \"dynamicOutputs\": [\n {\n \"name\": \"result\",\n \"label\": \"Result\",\n \"dataType\": \"string\"\n }\n ],\n \"branches\": [\n {\n \"name\": \"success\",\n \"label\": \"Success\",\n \"condition\": \"status === 200\"\n },\n {\n \"name\": \"error\",\n \"label\": \"Error\",\n \"isDefault\": true\n }\n ]\n },\n \"metadata\": {\n \"id\": \"calculator\",\n \"name\": \"Calculator\",\n \"description\": \"Perform mathematical operations on input data\",\n \"category\": \"processing\",\n \"version\": \"1.0.0\",\n \"inputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"outputs\": [\n {\n \"id\": \"json\",\n \"name\": \"JSON Response\",\n \"dataType\": \"mixed\",\n \"required\": false,\n \"description\": \"Parsed JSON response from the HTTP request\",\n \"defaultValue\": \"<unknown>\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user\": {\n \"type\": \"object\",\n \"title\": \"User\",\n \"description\": \"User information\",\n \"properties\": {\n \"id\": {\n \"type\": \"integer\",\n \"description\": \"User ID\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User full name\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"User email address\"\n },\n \"address\": {\n \"type\": \"object\",\n \"title\": \"Address\",\n \"properties\": {\n \"street\": {\n \"type\": \"string\"\n },\n \"city\": {\n \"type\": \"string\"\n },\n \"country\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"title\": \"Orders\",\n \"description\": \"List of user orders\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n },\n \"product_name\": {\n \"type\": \"string\"\n },\n \"quantity\": {\n \"type\": \"integer\"\n },\n \"price\": {\n \"type\": \"number\"\n }\n }\n }\n }\n }\n }\n }\n ],\n \"supportedTypes\": [],\n \"icon\": \"mdi:calculator\",\n \"color\": \"#3b82f6\",\n \"badge\": \"API\",\n \"portDataType\": \"trigger\",\n \"tags\": [\n \"math\",\n \"calculation\",\n \"processing\"\n ],\n \"formats\": [\n \"agentspec\"\n ],\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"isProcessing\": true,\n \"error\": \"<string>\",\n \"nodeId\": \"<string>\",\n \"extensions\": {\n \"ui\": {\n \"hideUnconnectedHandles\": true,\n \"style\": {\n \"opacity\": 0.8\n }\n },\n \"agentspec:component_type\": \"llm_node\",\n \"myapp:analytics\": {\n \"trackUsage\": true,\n \"customField\": \"value\"\n }\n }\n },\n \"deletable\": true\n }\n ],\n \"edges\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\",\n \"selectable\": true,\n \"deletable\": true,\n \"data\": {\n \"label\": \"<string>\",\n \"condition\": \"<string>\",\n \"metadata\": {\n \"sourcePortDataType\": \"<string>\"\n },\n \"isToolConnection\": true,\n \"targetNodeType\": \"<string>\",\n \"targetCategory\": \"<string>\"\n }\n }\n ],\n \"metadata\": {\n \"schemaVersion\": \"1.0.0\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"author\": \"admin\",\n \"tags\": [\n \"ai\",\n \"production\"\n ],\n \"versionId\": \"<string>\",\n \"updateNumber\": 123,\n \"format\": \"flowdrop\"\n },\n \"description\": \"<string>\",\n \"config\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"valid": true,
"errors": [
"<string>"
],
"warnings": [
"<string>"
],
"suggestions": [
"<string>"
]
},
"message": "<string>",
"error": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "VALIDATION_ERROR",
"details": {
"field": "name",
"message": "Name is required"
}
}{
"success": false,
"error": "Internal server error",
"code": "INTERNAL_ERROR"
}Authorizations
BearerAuthSessionAuth
JWT token for authentication
Body
application/json
Workflow UUID
Workflow name
Maximum string length:
200Example:
"My AI Workflow"
Workflow nodes
Show child attributes
Show child attributes
Workflow edges
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Workflow description
Maximum string length:
1000Custom workflow-level configuration values. Populated when a workflowSettingsSchema is provided to the editor.
Was this page helpful?
⌘I