curl --request POST \
--url https://api.openworklabs.com/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"pluginId": "<string>",
"description": "<string>",
"code": "<string>",
"receiptId": "<string>",
"currentInput": "<unknown>",
"inputSchema": "<unknown>",
"outputSchema": "<unknown>"
}
'import requests
url = "https://api.openworklabs.com/v1/workflows"
payload = {
"name": "<string>",
"pluginId": "<string>",
"description": "<string>",
"code": "<string>",
"receiptId": "<string>",
"currentInput": "<unknown>",
"inputSchema": "<unknown>",
"outputSchema": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
pluginId: '<string>',
description: '<string>',
code: '<string>',
receiptId: '<string>',
currentInput: '<unknown>',
inputSchema: '<unknown>',
outputSchema: '<unknown>'
})
};
fetch('https://api.openworklabs.com/v1/workflows', 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://api.openworklabs.com/v1/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'pluginId' => '<string>',
'description' => '<string>',
'code' => '<string>',
'receiptId' => '<string>',
'currentInput' => '<unknown>',
'inputSchema' => '<unknown>',
'outputSchema' => '<unknown>'
]),
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://api.openworklabs.com/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"pluginId\": \"<string>\",\n \"description\": \"<string>\",\n \"code\": \"<string>\",\n \"receiptId\": \"<string>\",\n \"currentInput\": \"<unknown>\",\n \"inputSchema\": \"<unknown>\",\n \"outputSchema\": \"<unknown>\"\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://api.openworklabs.com/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"pluginId\": \"<string>\",\n \"description\": \"<string>\",\n \"code\": \"<string>\",\n \"receiptId\": \"<string>\",\n \"currentInput\": \"<unknown>\",\n \"inputSchema\": \"<unknown>\",\n \"outputSchema\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"pluginId\": \"<string>\",\n \"description\": \"<string>\",\n \"code\": \"<string>\",\n \"receiptId\": \"<string>\",\n \"currentInput\": \"<unknown>\",\n \"inputSchema\": \"<unknown>\",\n \"outputSchema\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"pluginId": "<string>",
"configObjectId": "<string>",
"configObjectVersionId": "<string>",
"graph": {
"nodes": [
{
"id": "<string>",
"kind": "input",
"label": "<string>",
"fields": [
"<string>"
]
}
],
"edges": [
{
"from": "<string>",
"to": "<string>",
"label": "<string>",
"kind": "flow"
}
],
"parseError": "<string>"
},
"mermaid": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"capability": "<string>"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Save a successful Code Mode run as a Workflow inside an OpenWork Connect Plugin
Saves a successful authoring run as a reusable Workflow. Supply code or receiptId, or both with byte-identical source. Explicit receiptId requires a successful run from this caller in this organization within 15 minutes, retained source (encrypted shared storage when Redis is configured; process-local otherwise), and exactly matching tested input and schema digests; missing retention fails closed (400 workflow_authoring_receipt_required). Live receipts forbid currentInput, validate with their server-generated runtime, and never save runtime day bounds as example input. Without receiptId, the existing byte-exact recent successful code lookup applies (400 workflow_recent_receipt_required). Literal credentials in source are rejected, not sanitized. The run’s tool calls become requiredCapabilities and must still be available. Saving creates no artifact snapshot linkage. Omit pluginId for the private My Workflows Plugin; a chosen Plugin requires editor access. Replacing a same-name Workflow requires manager access.
curl --request POST \
--url https://api.openworklabs.com/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"pluginId": "<string>",
"description": "<string>",
"code": "<string>",
"receiptId": "<string>",
"currentInput": "<unknown>",
"inputSchema": "<unknown>",
"outputSchema": "<unknown>"
}
'import requests
url = "https://api.openworklabs.com/v1/workflows"
payload = {
"name": "<string>",
"pluginId": "<string>",
"description": "<string>",
"code": "<string>",
"receiptId": "<string>",
"currentInput": "<unknown>",
"inputSchema": "<unknown>",
"outputSchema": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
pluginId: '<string>',
description: '<string>',
code: '<string>',
receiptId: '<string>',
currentInput: '<unknown>',
inputSchema: '<unknown>',
outputSchema: '<unknown>'
})
};
fetch('https://api.openworklabs.com/v1/workflows', 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://api.openworklabs.com/v1/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'pluginId' => '<string>',
'description' => '<string>',
'code' => '<string>',
'receiptId' => '<string>',
'currentInput' => '<unknown>',
'inputSchema' => '<unknown>',
'outputSchema' => '<unknown>'
]),
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://api.openworklabs.com/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"pluginId\": \"<string>\",\n \"description\": \"<string>\",\n \"code\": \"<string>\",\n \"receiptId\": \"<string>\",\n \"currentInput\": \"<unknown>\",\n \"inputSchema\": \"<unknown>\",\n \"outputSchema\": \"<unknown>\"\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://api.openworklabs.com/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"pluginId\": \"<string>\",\n \"description\": \"<string>\",\n \"code\": \"<string>\",\n \"receiptId\": \"<string>\",\n \"currentInput\": \"<unknown>\",\n \"inputSchema\": \"<unknown>\",\n \"outputSchema\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"pluginId\": \"<string>\",\n \"description\": \"<string>\",\n \"code\": \"<string>\",\n \"receiptId\": \"<string>\",\n \"currentInput\": \"<unknown>\",\n \"inputSchema\": \"<unknown>\",\n \"outputSchema\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"pluginId": "<string>",
"configObjectId": "<string>",
"configObjectVersionId": "<string>",
"graph": {
"nodes": [
{
"id": "<string>",
"kind": "input",
"label": "<string>",
"fields": [
"<string>"
]
}
],
"edges": [
{
"from": "<string>",
"to": "<string>",
"label": "<string>",
"kind": "flow"
}
],
"parseError": "<string>"
},
"mermaid": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"capability": "<string>"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Session token passed as Authorization: Bearer <session-token> for user-authenticated Den routes.
Body
1 - 255Existing OpenWork Connect Plugin that will contain and share this Workflow. Omit to use the member's private My Workflows Plugin.
1 - 1604000Exact tested source. Required without receiptId; if both are supplied it must byte-match the retained source.
1 - 200000Successful authoring receipt from this caller within 15 minutes. Encrypted source retention is shared across replicas when Redis is configured, otherwise process-local. If unavailable, retest or omit receiptId and supply the exact source.
1 - 160Must match the tested input when receiptId is supplied. Forbidden for live authoring receipts.
Optional JSON Schema for the value returned by this Workflow.
Was this page helpful?