curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/workflows/validate-definition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"do": [],
"document": {
"dsl": "1.0.0",
"name": "notify",
"version": "1.0.0"
}
}
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/workflows/validate-definition"
payload = { "definition": {
"do": [],
"document": {
"dsl": "1.0.0",
"name": "notify",
"version": "1.0.0"
}
} }
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({
definition: {do: [], document: {dsl: '1.0.0', name: 'notify', version: '1.0.0'}}
})
};
fetch('https://app.base44.com/api/apps/{app_id}/workflows/validate-definition', 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://app.base44.com/api/apps/{app_id}/workflows/validate-definition",
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([
'definition' => [
'do' => [
],
'document' => [
'dsl' => '1.0.0',
'name' => 'notify',
'version' => '1.0.0'
]
]
]),
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://app.base44.com/api/apps/{app_id}/workflows/validate-definition"
payload := strings.NewReader("{\n \"definition\": {\n \"do\": [],\n \"document\": {\n \"dsl\": \"1.0.0\",\n \"name\": \"notify\",\n \"version\": \"1.0.0\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/workflows/validate-definition")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"do\": [],\n \"document\": {\n \"dsl\": \"1.0.0\",\n \"name\": \"notify\",\n \"version\": \"1.0.0\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/workflows/validate-definition")
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 \"definition\": {\n \"do\": [],\n \"document\": {\n \"dsl\": \"1.0.0\",\n \"name\": \"notify\",\n \"version\": \"1.0.0\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [
{
"code": "UNSUPPORTED_TASK_TYPE",
"location": "do[0].notify",
"message": "Task 'notify' has no supported type key. Supported: ['call', 'switch', 'wait']"
}
],
"supported_task_types": [
"call",
"switch",
"wait"
],
"available_activities": [
"compute_seconds_until",
"invoke_backend_function"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Validate a workflow definition
Checks a workflow definition and tells you what is wrong with it, without saving anything.
Call this before Create workflow or Update workflow to catch problems while you still have the definition in hand. An invalid definition doesn’t fail the call. It comes back with valid set to false and the problems listed in errors, so branch on valid rather than on whether the call succeeded.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/workflows/validate-definition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"do": [],
"document": {
"dsl": "1.0.0",
"name": "notify",
"version": "1.0.0"
}
}
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/workflows/validate-definition"
payload = { "definition": {
"do": [],
"document": {
"dsl": "1.0.0",
"name": "notify",
"version": "1.0.0"
}
} }
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({
definition: {do: [], document: {dsl: '1.0.0', name: 'notify', version: '1.0.0'}}
})
};
fetch('https://app.base44.com/api/apps/{app_id}/workflows/validate-definition', 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://app.base44.com/api/apps/{app_id}/workflows/validate-definition",
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([
'definition' => [
'do' => [
],
'document' => [
'dsl' => '1.0.0',
'name' => 'notify',
'version' => '1.0.0'
]
]
]),
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://app.base44.com/api/apps/{app_id}/workflows/validate-definition"
payload := strings.NewReader("{\n \"definition\": {\n \"do\": [],\n \"document\": {\n \"dsl\": \"1.0.0\",\n \"name\": \"notify\",\n \"version\": \"1.0.0\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/workflows/validate-definition")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"do\": [],\n \"document\": {\n \"dsl\": \"1.0.0\",\n \"name\": \"notify\",\n \"version\": \"1.0.0\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/workflows/validate-definition")
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 \"definition\": {\n \"do\": [],\n \"document\": {\n \"dsl\": \"1.0.0\",\n \"name\": \"notify\",\n \"version\": \"1.0.0\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [
{
"code": "UNSUPPORTED_TASK_TYPE",
"location": "do[0].notify",
"message": "Task 'notify' has no supported type key. Supported: ['call', 'switch', 'wait']"
}
],
"supported_task_types": [
"call",
"switch",
"wait"
],
"available_activities": [
"compute_seconds_until",
"invoke_backend_function"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app whose workflows you want to work with.
Body
The CNCF Serverless Workflow v1.0 document to check.
{
"do": [],
"document": {
"dsl": "1.0.0",
"name": "notify",
"version": "1.0.0"
}
}
Response
The verdict. Check valid, not the status code.
Whether the definition can be saved as-is.
true
What is wrong with the definition, one entry per problem, each with a code, a human-readable message, and a location pointing into the definition. Empty when valid is true.
[
{
"code": "UNSUPPORTED_TASK_TYPE",
"location": "do[0].notify",
"message": "Task 'notify' has no supported type key. Supported: ['call', 'switch', 'wait']"
}
]
The fixed set of task types a definition's do steps can use, call, switch, or wait. This doesn't vary by app.
["call", "switch", "wait"]
The activities a call task on this app can invoke. This varies by app.
[
"compute_seconds_until",
"invoke_backend_function"
]
Was this page helpful?