Workflows
Validate workflow
Prove a workflow will work before it runs, step by step, and send nothing.
POST
/
workflows
/
{id}
/
validate
Check a workflow will work, sending nothing
curl --request POST \
--url https://www.orgo.ai/api/workflows/{id}/validate \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.orgo.ai/api/workflows/{id}/validate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.orgo.ai/api/workflows/{id}/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.orgo.ai/api/workflows/{id}/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.orgo.ai/api/workflows/{id}/validate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.orgo.ai/api/workflows/{id}/validate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/workflows/{id}/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": false,
"steps": [
{
"step": "a",
"ok": true
},
{
"step": "b",
"ok": false,
"say": "Slack isn’t connected on this computer.",
"fix": {
"action": "reconnect",
"app": "slack",
"label": "Connect Slack"
}
}
],
"to_fix": [
"Connect Slack"
]
}{
"error": "<string>",
"code": "<string>",
"say": "<string>",
"next": "<string>",
"to_fix": [
"<string>"
],
"problems": [
{}
],
"version": 123,
"lines": "<string>"
}{
"error": "<string>",
"code": "<string>",
"say": "<string>",
"next": "<string>",
"to_fix": [
"<string>"
],
"problems": [
{}
],
"version": 123,
"lines": "<string>"
}{
"error": "<string>",
"code": "<string>",
"say": "<string>",
"next": "<string>",
"to_fix": [
"<string>"
],
"problems": [
{}
],
"version": 123,
"lines": "<string>"
}{
"error": "Too many API requests this minute (120 a minute on your plan). Try again in 12 seconds.",
"code": "rate_limited",
"limit": "api_other_per_minute",
"retry_after": 12
}{
"error": "Service temporarily unavailable. The database is not accepting requests. Retry shortly."
}Checks each step of a workflow now and sends nothing. It looks at the workflow’s computer (without waking it), each agent installed there, each app signed in (with a read that proves it), the channels and sheets it names, the secrets its scripts read (by name only) and your credit. Validate before you turn a workflow on, and after you change it.
A step that would fail answers
say (what is in the way, in a sentence) and fix (the one thing that fixes it).
Path parameters
Headers
text/event-stream streams each step as it is known (event: step), then the whole answer (event: done). Anything else answers JSON once every step is checked.Response
Each step’s answer.
Show Step
Show Step
Example
curl -X POST https://www.orgo.ai/api/workflows/morning-report/validate \
-H "Authorization: Bearer $ORGO_API_KEY"
curl -N -X POST https://www.orgo.ai/api/workflows/morning-report/validate \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Accept: text/event-stream"
import os, requests
r = requests.post(
"https://www.orgo.ai/api/workflows/morning-report/validate",
headers={"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"},
)
result = r.json()
for s in result["steps"]:
if not s["ok"]:
print(s["step"], s["say"])
Response
{
"ok": false,
"steps": [
{ "step": "a", "ok": true },
{ "step": "b", "ok": false, "say": "Slack isn’t connected on this computer.", "fix": { "action": "reconnect", "app": "slack", "label": "Connect Slack" } }
],
"to_fix": ["Connect Slack"]
}
Stream
event: step
data: {"step":"a","ok":true}
event: done
data: {"ok":true,"steps":[{"step":"a","ok":true}],"to_fix":[]}
Errors
| Status | Code | When |
|---|---|---|
401 | No key, or a key Orgo doesn’t know. | |
403 | key_permission | A restricted key without Workflows read, or without Control write and AI write for a workflow that has a computer. |
403 | computer_key_held | A restricted or expiring key, and the workflow’s computer holds its own Orgo key. |
404 | not_found | No workflow by that id. |
404 | (no body) | Workflows aren’t open to your account. |
429 | rate_limited | Your plan’s rate limit for other API calls. Carries Retry-After. |
503 | Orgo couldn’t verify the key because of a server-side fault. Retry. |
⌘I
Check a workflow will work, sending nothing
curl --request POST \
--url https://www.orgo.ai/api/workflows/{id}/validate \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.orgo.ai/api/workflows/{id}/validate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.orgo.ai/api/workflows/{id}/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.orgo.ai/api/workflows/{id}/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.orgo.ai/api/workflows/{id}/validate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.orgo.ai/api/workflows/{id}/validate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/workflows/{id}/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": false,
"steps": [
{
"step": "a",
"ok": true
},
{
"step": "b",
"ok": false,
"say": "Slack isn’t connected on this computer.",
"fix": {
"action": "reconnect",
"app": "slack",
"label": "Connect Slack"
}
}
],
"to_fix": [
"Connect Slack"
]
}{
"error": "<string>",
"code": "<string>",
"say": "<string>",
"next": "<string>",
"to_fix": [
"<string>"
],
"problems": [
{}
],
"version": 123,
"lines": "<string>"
}{
"error": "<string>",
"code": "<string>",
"say": "<string>",
"next": "<string>",
"to_fix": [
"<string>"
],
"problems": [
{}
],
"version": 123,
"lines": "<string>"
}{
"error": "<string>",
"code": "<string>",
"say": "<string>",
"next": "<string>",
"to_fix": [
"<string>"
],
"problems": [
{}
],
"version": 123,
"lines": "<string>"
}{
"error": "Too many API requests this minute (120 a minute on your plan). Try again in 12 seconds.",
"code": "rate_limited",
"limit": "api_other_per_minute",
"retry_after": 12
}{
"error": "Service temporarily unavailable. The database is not accepting requests. Retry shortly."
}