Workflows
Add a node to a workflow draft
Add one typed node to a workflow’s editable draft through the Console builder’s checks.
POST
/
api
/
v3
/
workflows
/
{workflowId}
/
draft-nodes
Add a node to a workflow draft
curl --request POST \
--url https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"position": {
"x": 123,
"y": 123
},
"description": "<string>",
"config": {
"prompt": "<string>",
"timeout": 123,
"onTimeout": "<string>",
"maxOutputTokens": 123,
"includeUpstreamOutputs": [
"<string>"
],
"inputs": {},
"outputs": {},
"routingStrategy": "<string>",
"rules": [
{
"label": "<string>",
"condition": "<string>"
}
],
"routingPrompt": "<string>",
"routeOptions": [
{
"label": "<string>",
"description": "<string>",
"id": "<string>"
}
],
"multiSelect": true,
"joinStrategy": "<string>",
"joinThreshold": 123,
"message": "<string>"
}
}
'import requests
url = "https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes"
payload = {
"name": "<string>",
"position": {
"x": 123,
"y": 123
},
"description": "<string>",
"config": {
"prompt": "<string>",
"timeout": 123,
"onTimeout": "<string>",
"maxOutputTokens": 123,
"includeUpstreamOutputs": ["<string>"],
"inputs": {},
"outputs": {},
"routingStrategy": "<string>",
"rules": [
{
"label": "<string>",
"condition": "<string>"
}
],
"routingPrompt": "<string>",
"routeOptions": [
{
"label": "<string>",
"description": "<string>",
"id": "<string>"
}
],
"multiSelect": True,
"joinStrategy": "<string>",
"joinThreshold": 123,
"message": "<string>"
}
}
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>',
position: {x: 123, y: 123},
description: '<string>',
config: {
prompt: '<string>',
timeout: 123,
onTimeout: '<string>',
maxOutputTokens: 123,
includeUpstreamOutputs: ['<string>'],
inputs: {},
outputs: {},
routingStrategy: '<string>',
rules: [{label: '<string>', condition: '<string>'}],
routingPrompt: '<string>',
routeOptions: [{label: '<string>', description: '<string>', id: '<string>'}],
multiSelect: true,
joinStrategy: '<string>',
joinThreshold: 123,
message: '<string>'
}
})
};
fetch('https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes', 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.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes",
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>',
'position' => [
'x' => 123,
'y' => 123
],
'description' => '<string>',
'config' => [
'prompt' => '<string>',
'timeout' => 123,
'onTimeout' => '<string>',
'maxOutputTokens' => 123,
'includeUpstreamOutputs' => [
'<string>'
],
'inputs' => [
],
'outputs' => [
],
'routingStrategy' => '<string>',
'rules' => [
[
'label' => '<string>',
'condition' => '<string>'
]
],
'routingPrompt' => '<string>',
'routeOptions' => [
[
'label' => '<string>',
'description' => '<string>',
'id' => '<string>'
]
],
'multiSelect' => true,
'joinStrategy' => '<string>',
'joinThreshold' => 123,
'message' => '<string>'
]
]),
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.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"description\": \"<string>\",\n \"config\": {\n \"prompt\": \"<string>\",\n \"timeout\": 123,\n \"onTimeout\": \"<string>\",\n \"maxOutputTokens\": 123,\n \"includeUpstreamOutputs\": [\n \"<string>\"\n ],\n \"inputs\": {},\n \"outputs\": {},\n \"routingStrategy\": \"<string>\",\n \"rules\": [\n {\n \"label\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ],\n \"routingPrompt\": \"<string>\",\n \"routeOptions\": [\n {\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"multiSelect\": true,\n \"joinStrategy\": \"<string>\",\n \"joinThreshold\": 123,\n \"message\": \"<string>\"\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://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"description\": \"<string>\",\n \"config\": {\n \"prompt\": \"<string>\",\n \"timeout\": 123,\n \"onTimeout\": \"<string>\",\n \"maxOutputTokens\": 123,\n \"includeUpstreamOutputs\": [\n \"<string>\"\n ],\n \"inputs\": {},\n \"outputs\": {},\n \"routingStrategy\": \"<string>\",\n \"rules\": [\n {\n \"label\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ],\n \"routingPrompt\": \"<string>\",\n \"routeOptions\": [\n {\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"multiSelect\": true,\n \"joinStrategy\": \"<string>\",\n \"joinThreshold\": 123,\n \"message\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes")
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 \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"description\": \"<string>\",\n \"config\": {\n \"prompt\": \"<string>\",\n \"timeout\": 123,\n \"onTimeout\": \"<string>\",\n \"maxOutputTokens\": 123,\n \"includeUpstreamOutputs\": [\n \"<string>\"\n ],\n \"inputs\": {},\n \"outputs\": {},\n \"routingStrategy\": \"<string>\",\n \"rules\": [\n {\n \"label\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ],\n \"routingPrompt\": \"<string>\",\n \"routeOptions\": [\n {\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"multiSelect\": true,\n \"joinStrategy\": \"<string>\",\n \"joinThreshold\": 123,\n \"message\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"workflowId": "<string>",
"draftId": "<string>",
"node": {
"nodeId": "<string>",
"type": "produce",
"name": "<string>",
"position": {
"x": 123,
"y": 123
},
"config": {
"prompt": "<string>",
"timeout": 123,
"onTimeout": "<string>",
"maxOutputTokens": 123,
"tier": "nano",
"presentationHint": "approval",
"includeUpstreamOutputs": [
"<string>"
],
"inputs": {},
"outputs": {},
"outcomeRouting": {
"output": "<string>",
"exceptionValues": [
"<string>"
]
},
"routingStrategy": "<string>",
"rules": [
{
"label": "<string>",
"condition": "<string>"
}
],
"routingPrompt": "<string>",
"routeOptions": [
{
"label": "<string>",
"description": "<string>",
"id": "<string>"
}
],
"multiSelect": true,
"joinStrategy": "<string>",
"joinThreshold": 123,
"publishMessageFormat": "structured",
"publishPresentation": {
"title": "<string>",
"summary": "<string>",
"status": {
"kind": "static",
"value": "info"
},
"facts": [
{
"label": "<string>",
"value": "<string>"
}
],
"warnings": [
"<string>"
],
"body": "<string>"
},
"message": "<string>"
},
"consoleOnlyConfig": [
"<string>"
],
"createdAt": 123,
"updatedAt": 123,
"logicalNodeId": "<string>",
"description": "<string>"
}
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "resource_missing",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unprocessable",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.
v2 compatibility notes
POST /api/v2/workflows/createDraftNode
Adds one node to the workflow’s editable draft through the same checks the Forge Console builder runs, and gives it a new logicalNodeId. The builder shows the node at once.
Authentication
External App credential or platform API key. Requires permissionworkflows:write, and the caller must hold both workflows:read and workflows:write at the workflow’s home org unit. Any External App or platform API key with those grants may edit; who created the workflow lends no authority. The org unit a request acts from is not the workflow’s home.
Body
What a machine can change
A node’sconfig takes only the structure and content fields: prompt, timeout, onTimeout, maxOutputTokens, tier, presentationHint, includeUpstreamOutputs, inputs, outputs, outcomeRouting, routingStrategy, rules, routingPrompt, routeOptions, multiSelect, joinStrategy, joinThreshold, publishMessageFormat, publishPresentation and message.
Every field that names an agent, worker, person, role, recipient, channel, address, credential, tool, skill, procedure, model or sandbox stays Console-only: agentDefinitionId, agentVersion, pinnedToolContract, toolOverrides, estimatedCost, autoInjectCases, workerAssignment, syndicationTargets, slackChannel, escalationChannel, assignee, routingModel, routerAgentOverride, destination, apiEndpoint, channelId, emailTo, emailSubject, notifyChannels, notifyRecipients, notifyTitle, validation, sandbox, capabilityHints, pinnedSkillVersions, procedureId, procedureVersion, sourceStepId and credentialBindings. A body that names one answers 400, and a write never sets, clears or reads them. A produce node therefore needs a person to assign its agent or worker in the Console before the workflow can be published.
Responses
201 with:
The node as getDraftGraph returns it:
nodeId, logicalNodeId, type, name, description, position, config and consoleOnlyConfig.Errors
| Status | Code | When |
|---|---|---|
400 | bad_request | Malformed JSON, an unknown or Console-only key, a wrong type, or a blank name. Message: Invalid workflow draft graph body. |
403 | permission_denied | The credential’s scopes do not include workflows:write. |
404 | resource_missing | The workflow id is malformed, or the workflow is missing, trashed, has no home or draft, or the caller lacks workflows:read and workflows:write at its home: Workflow not found. |
409 | conflict | The name is already used in this draft: Node name "<name>" already exists in this draft. |
422 | unprocessable | A graph rule refuses the node, for example outcome routing on a draft that has not opted in. An output schemaComponentId that is not a schema component of this draft answers An output schemaComponentId must name a schema component of this draft. A draft that already holds 200 nodes, or more than 400 edges, answers This draft is too large to edit through the API; edit it in the Console. |
409 | idempotency_result_unavailable | A keyed repeat whose recorded result cannot be disclosed now. |
500 | internal_error | Unexpected error. |
Retries
Send anIdempotency-Key header to retry safely. Within 24 hours, the same key and body return the recorded status and body, with Idempotency-Replayed: true, while the caller still holds workflows:write and can read the workflow. Otherwise the repeat answers 409 idempotency_result_unavailable and does not write again. A new key is a new write. Without a key, a retried create meets the node-name rule (409) or the one-edge-per-pair rule (422), and a retried delete answers 404. If an outcome is unknown, read getDraftGraph before acting again.Authorizations
BearerAuthPlatformApiKeyPersonalKey
Body
application/json
⌘I
Add a node to a workflow draft
curl --request POST \
--url https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"position": {
"x": 123,
"y": 123
},
"description": "<string>",
"config": {
"prompt": "<string>",
"timeout": 123,
"onTimeout": "<string>",
"maxOutputTokens": 123,
"includeUpstreamOutputs": [
"<string>"
],
"inputs": {},
"outputs": {},
"routingStrategy": "<string>",
"rules": [
{
"label": "<string>",
"condition": "<string>"
}
],
"routingPrompt": "<string>",
"routeOptions": [
{
"label": "<string>",
"description": "<string>",
"id": "<string>"
}
],
"multiSelect": true,
"joinStrategy": "<string>",
"joinThreshold": 123,
"message": "<string>"
}
}
'import requests
url = "https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes"
payload = {
"name": "<string>",
"position": {
"x": 123,
"y": 123
},
"description": "<string>",
"config": {
"prompt": "<string>",
"timeout": 123,
"onTimeout": "<string>",
"maxOutputTokens": 123,
"includeUpstreamOutputs": ["<string>"],
"inputs": {},
"outputs": {},
"routingStrategy": "<string>",
"rules": [
{
"label": "<string>",
"condition": "<string>"
}
],
"routingPrompt": "<string>",
"routeOptions": [
{
"label": "<string>",
"description": "<string>",
"id": "<string>"
}
],
"multiSelect": True,
"joinStrategy": "<string>",
"joinThreshold": 123,
"message": "<string>"
}
}
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>',
position: {x: 123, y: 123},
description: '<string>',
config: {
prompt: '<string>',
timeout: 123,
onTimeout: '<string>',
maxOutputTokens: 123,
includeUpstreamOutputs: ['<string>'],
inputs: {},
outputs: {},
routingStrategy: '<string>',
rules: [{label: '<string>', condition: '<string>'}],
routingPrompt: '<string>',
routeOptions: [{label: '<string>', description: '<string>', id: '<string>'}],
multiSelect: true,
joinStrategy: '<string>',
joinThreshold: 123,
message: '<string>'
}
})
};
fetch('https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes', 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.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes",
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>',
'position' => [
'x' => 123,
'y' => 123
],
'description' => '<string>',
'config' => [
'prompt' => '<string>',
'timeout' => 123,
'onTimeout' => '<string>',
'maxOutputTokens' => 123,
'includeUpstreamOutputs' => [
'<string>'
],
'inputs' => [
],
'outputs' => [
],
'routingStrategy' => '<string>',
'rules' => [
[
'label' => '<string>',
'condition' => '<string>'
]
],
'routingPrompt' => '<string>',
'routeOptions' => [
[
'label' => '<string>',
'description' => '<string>',
'id' => '<string>'
]
],
'multiSelect' => true,
'joinStrategy' => '<string>',
'joinThreshold' => 123,
'message' => '<string>'
]
]),
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.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"description\": \"<string>\",\n \"config\": {\n \"prompt\": \"<string>\",\n \"timeout\": 123,\n \"onTimeout\": \"<string>\",\n \"maxOutputTokens\": 123,\n \"includeUpstreamOutputs\": [\n \"<string>\"\n ],\n \"inputs\": {},\n \"outputs\": {},\n \"routingStrategy\": \"<string>\",\n \"rules\": [\n {\n \"label\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ],\n \"routingPrompt\": \"<string>\",\n \"routeOptions\": [\n {\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"multiSelect\": true,\n \"joinStrategy\": \"<string>\",\n \"joinThreshold\": 123,\n \"message\": \"<string>\"\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://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"description\": \"<string>\",\n \"config\": {\n \"prompt\": \"<string>\",\n \"timeout\": 123,\n \"onTimeout\": \"<string>\",\n \"maxOutputTokens\": 123,\n \"includeUpstreamOutputs\": [\n \"<string>\"\n ],\n \"inputs\": {},\n \"outputs\": {},\n \"routingStrategy\": \"<string>\",\n \"rules\": [\n {\n \"label\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ],\n \"routingPrompt\": \"<string>\",\n \"routeOptions\": [\n {\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"multiSelect\": true,\n \"joinStrategy\": \"<string>\",\n \"joinThreshold\": 123,\n \"message\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.forge.gloo.com/api/v3/workflows/{workflowId}/draft-nodes")
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 \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"description\": \"<string>\",\n \"config\": {\n \"prompt\": \"<string>\",\n \"timeout\": 123,\n \"onTimeout\": \"<string>\",\n \"maxOutputTokens\": 123,\n \"includeUpstreamOutputs\": [\n \"<string>\"\n ],\n \"inputs\": {},\n \"outputs\": {},\n \"routingStrategy\": \"<string>\",\n \"rules\": [\n {\n \"label\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ],\n \"routingPrompt\": \"<string>\",\n \"routeOptions\": [\n {\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"multiSelect\": true,\n \"joinStrategy\": \"<string>\",\n \"joinThreshold\": 123,\n \"message\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"workflowId": "<string>",
"draftId": "<string>",
"node": {
"nodeId": "<string>",
"type": "produce",
"name": "<string>",
"position": {
"x": 123,
"y": 123
},
"config": {
"prompt": "<string>",
"timeout": 123,
"onTimeout": "<string>",
"maxOutputTokens": 123,
"tier": "nano",
"presentationHint": "approval",
"includeUpstreamOutputs": [
"<string>"
],
"inputs": {},
"outputs": {},
"outcomeRouting": {
"output": "<string>",
"exceptionValues": [
"<string>"
]
},
"routingStrategy": "<string>",
"rules": [
{
"label": "<string>",
"condition": "<string>"
}
],
"routingPrompt": "<string>",
"routeOptions": [
{
"label": "<string>",
"description": "<string>",
"id": "<string>"
}
],
"multiSelect": true,
"joinStrategy": "<string>",
"joinThreshold": 123,
"publishMessageFormat": "structured",
"publishPresentation": {
"title": "<string>",
"summary": "<string>",
"status": {
"kind": "static",
"value": "info"
},
"facts": [
{
"label": "<string>",
"value": "<string>"
}
],
"warnings": [
"<string>"
],
"body": "<string>"
},
"message": "<string>"
},
"consoleOnlyConfig": [
"<string>"
],
"createdAt": 123,
"updatedAt": 123,
"logicalNodeId": "<string>",
"description": "<string>"
}
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "resource_missing",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unprocessable",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"docUrl": "<string>",
"reason": "requester_unavailable",
"requiredPermission": "<string>",
"personRequired": true,
"decisionId": "<string>",
"capHeadroom": {
"remainingCents": 123,
"capCents": 123,
"consumedCents": 123,
"estimateCents": 123
},
"details": [
{
"path": "<string>",
"param": "<string>",
"message": "<string>",
"code": "required"
}
]
},
"meta": {
"requestId": "<string>",
"hasMore": true,
"nextCursor": "<string>",
"asOf": 123
}
}
