curl --request POST \
--url https://api.openworklabs.com/v1/workflows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--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 = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', '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 => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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("x-api-key", "<api-key>")
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("x-api-key", "<api-key>")
.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["x-api-key"] = '<api-key>'
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>",
"name": "<string>",
"libraryUrl": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<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 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--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 = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', '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 => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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("x-api-key", "<api-key>")
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("x-api-key", "<api-key>")
.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["x-api-key"] = '<api-key>'
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>",
"name": "<string>",
"libraryUrl": "<string>"
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
Response
Workflow saved.
Was this page helpful?