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"
}
},
"trigger_type": "scheduled",
"trigger": {
"condition": "${ .trigger.data.status == \"open\" }",
"config": {
"entity_name": "Task",
"events": [
"create"
],
"trigger_type": "entity"
}
}
}
'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"
}
},
"trigger_type": "scheduled",
"trigger": {
"condition": "${ .trigger.data.status == \"open\" }",
"config": {
"entity_name": "Task",
"events": ["create"],
"trigger_type": "entity"
}
}
}
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'}},
trigger_type: 'scheduled',
trigger: {
condition: '${ .trigger.data.status == "open" }',
config: {entity_name: 'Task', events: ['create'], trigger_type: 'entity'}
}
})
};
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'
]
],
'trigger_type' => 'scheduled',
'trigger' => [
'condition' => '${ .trigger.data.status == "open" }',
'config' => [
'entity_name' => 'Task',
'events' => [
'create'
],
'trigger_type' => 'entity'
]
]
]),
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 \"trigger_type\": \"scheduled\",\n \"trigger\": {\n \"condition\": \"${ .trigger.data.status == \\\"open\\\" }\",\n \"config\": {\n \"entity_name\": \"Task\",\n \"events\": [\n \"create\"\n ],\n \"trigger_type\": \"entity\"\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 \"trigger_type\": \"scheduled\",\n \"trigger\": {\n \"condition\": \"${ .trigger.data.status == \\\"open\\\" }\",\n \"config\": {\n \"entity_name\": \"Task\",\n \"events\": [\n \"create\"\n ],\n \"trigger_type\": \"entity\"\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 \"trigger_type\": \"scheduled\",\n \"trigger\": {\n \"condition\": \"${ .trigger.data.status == \\\"open\\\" }\",\n \"config\": {\n \"entity_name\": \"Task\",\n \"events\": [\n \"create\"\n ],\n \"trigger_type\": \"entity\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"warnings": [],
"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"
]
}Validate a workflow definition
Checks a workflow definition and tells you what is wrong with it, without saving anything.
Call this before Create a workflow (not imported apps) or Update workflow (not imported apps) 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.
Send the trigger you plan to create the workflow with to check it too. Its type must be available for this app, its condition must be valid jq that is simple enough to run on every event, and a hook’s steps must follow the hook rules. A trigger that create would refuse for these reasons comes back here with the same code and message. The trigger is checked as part of a new workflow: a condition that an existing workflow already uses passes Update workflow until you edit it, but is refused here. This call doesn’t check the trigger against the app’s current state, such as whether its entity exists, so create can still refuse a trigger that passes here.
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"
}
},
"trigger_type": "scheduled",
"trigger": {
"condition": "${ .trigger.data.status == \"open\" }",
"config": {
"entity_name": "Task",
"events": [
"create"
],
"trigger_type": "entity"
}
}
}
'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"
}
},
"trigger_type": "scheduled",
"trigger": {
"condition": "${ .trigger.data.status == \"open\" }",
"config": {
"entity_name": "Task",
"events": ["create"],
"trigger_type": "entity"
}
}
}
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'}},
trigger_type: 'scheduled',
trigger: {
condition: '${ .trigger.data.status == "open" }',
config: {entity_name: 'Task', events: ['create'], trigger_type: 'entity'}
}
})
};
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'
]
],
'trigger_type' => 'scheduled',
'trigger' => [
'condition' => '${ .trigger.data.status == "open" }',
'config' => [
'entity_name' => 'Task',
'events' => [
'create'
],
'trigger_type' => 'entity'
]
]
]),
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 \"trigger_type\": \"scheduled\",\n \"trigger\": {\n \"condition\": \"${ .trigger.data.status == \\\"open\\\" }\",\n \"config\": {\n \"entity_name\": \"Task\",\n \"events\": [\n \"create\"\n ],\n \"trigger_type\": \"entity\"\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 \"trigger_type\": \"scheduled\",\n \"trigger\": {\n \"condition\": \"${ .trigger.data.status == \\\"open\\\" }\",\n \"config\": {\n \"entity_name\": \"Task\",\n \"events\": [\n \"create\"\n ],\n \"trigger_type\": \"entity\"\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 \"trigger_type\": \"scheduled\",\n \"trigger\": {\n \"condition\": \"${ .trigger.data.status == \\\"open\\\" }\",\n \"config\": {\n \"entity_name\": \"Task\",\n \"events\": [\n \"create\"\n ],\n \"trigger_type\": \"entity\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"warnings": [],
"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"
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Scopes
Headers
Body
The trigger you plan to create the workflow with, in the same shape as trigger on Create workflow. When sent, the trigger and its condition are checked with the rules create applies to a new workflow, and a refusal comes back in errors with the code and message create would return. Leave it out to check only the definition.
{
"condition": "${ .trigger.data.status == \"open\" }",
"config": {
"entity_name": "Task",
"events": ["create"],
"trigger_type": "entity"
}
}
Response
The verdict. Check valid, not the status code.
What is wrong with the definition or trigger, one entry per problem, each with a code, a human-readable message, and a location pointing at the problem, empty when the problem has no single place. 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?