curl --request PUT \
--url https://api.goyappr.com/agents/{id}/workflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 4503599627370496,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": [
"<string>"
],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": false,
"global_instructions": "",
"channels": [],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": {
"positions": {}
},
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
}
}
'import requests
url = "https://api.goyappr.com/agents/{id}/workflow"
payload = {
"expected_version": 4503599627370496,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": ["<string>"],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": False,
"global_instructions": "",
"channels": [],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": ["<string>"],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": ["<string>"],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": ["<string>"],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": { "positions": {} },
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 4503599627370496,
document: {
id: '<string>',
name: '<string>',
conversation: {
entry_node_id: '<string>',
nodes: [
{
id: '<string>',
label: '<string>',
type: 'conversation',
instructions: '<string>',
available_binding_ids: ['<string>'],
binding_overrides: {}
}
],
edges: [
{
id: '<string>',
source: '<string>',
target: '<string>',
kind: 'conversation',
condition: '<string>'
}
],
global_edges: [{id: '<string>', target: '<string>', condition: '<string>'}]
},
schema_version: '1',
strict_mode: false,
global_instructions: '',
channels: [],
request_schema: {},
stored_schema: {},
bindings: [
{
id: '<string>',
tool_revision_id: '<string>',
tool_revision_policy: 'follow_current',
inputs: {}
}
],
before: {
steps: [
{
id: '<string>',
label: '<string>',
binding_id: '<string>',
depends_on: ['<string>'],
requires: [],
on_failure: 'stop',
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
},
on_succeeded: '<string>',
on_failed: '<string>'
}
],
on_failure: 'stop_admission'
},
after: [
{
id: '<string>',
steps: [
{
id: '<string>',
label: '<string>',
binding_id: '<string>',
depends_on: ['<string>'],
requires: [],
on_failure: 'stop',
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
},
on_succeeded: '<string>',
on_failed: '<string>'
}
],
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
}
}
],
sequences: [
{
id: '<string>',
name: '<string>',
steps: [
{
id: '<string>',
label: '<string>',
binding_id: '<string>',
depends_on: ['<string>'],
requires: [],
on_failure: 'stop',
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
},
on_succeeded: '<string>',
on_failed: '<string>'
}
],
description: '',
input_schema: {},
output_schema: {},
output_mapping: {}
}
],
editor: {positions: {}},
integrations: [
{
id: '<string>',
connection_id: '<string>',
app: '<string>',
actions: [{action: '<string>', binding_id: '<string>'}]
}
]
}
})
};
fetch('https://api.goyappr.com/agents/{id}/workflow', 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.goyappr.com/agents/{id}/workflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 4503599627370496,
'document' => [
'id' => '<string>',
'name' => '<string>',
'conversation' => [
'entry_node_id' => '<string>',
'nodes' => [
[
'id' => '<string>',
'label' => '<string>',
'type' => 'conversation',
'instructions' => '<string>',
'available_binding_ids' => [
'<string>'
],
'binding_overrides' => [
]
]
],
'edges' => [
[
'id' => '<string>',
'source' => '<string>',
'target' => '<string>',
'kind' => 'conversation',
'condition' => '<string>'
]
],
'global_edges' => [
[
'id' => '<string>',
'target' => '<string>',
'condition' => '<string>'
]
]
],
'schema_version' => '1',
'strict_mode' => false,
'global_instructions' => '',
'channels' => [
],
'request_schema' => [
],
'stored_schema' => [
],
'bindings' => [
[
'id' => '<string>',
'tool_revision_id' => '<string>',
'tool_revision_policy' => 'follow_current',
'inputs' => [
]
]
],
'before' => [
'steps' => [
[
'id' => '<string>',
'label' => '<string>',
'binding_id' => '<string>',
'depends_on' => [
'<string>'
],
'requires' => [
],
'on_failure' => 'stop',
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
],
'on_succeeded' => '<string>',
'on_failed' => '<string>'
]
],
'on_failure' => 'stop_admission'
],
'after' => [
[
'id' => '<string>',
'steps' => [
[
'id' => '<string>',
'label' => '<string>',
'binding_id' => '<string>',
'depends_on' => [
'<string>'
],
'requires' => [
],
'on_failure' => 'stop',
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
],
'on_succeeded' => '<string>',
'on_failed' => '<string>'
]
],
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
]
]
],
'sequences' => [
[
'id' => '<string>',
'name' => '<string>',
'steps' => [
[
'id' => '<string>',
'label' => '<string>',
'binding_id' => '<string>',
'depends_on' => [
'<string>'
],
'requires' => [
],
'on_failure' => 'stop',
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
],
'on_succeeded' => '<string>',
'on_failed' => '<string>'
]
],
'description' => '',
'input_schema' => [
],
'output_schema' => [
],
'output_mapping' => [
]
]
],
'editor' => [
'positions' => [
]
],
'integrations' => [
[
'id' => '<string>',
'connection_id' => '<string>',
'app' => '<string>',
'actions' => [
[
'action' => '<string>',
'binding_id' => '<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.goyappr.com/agents/{id}/workflow"
payload := strings.NewReader("{\n \"expected_version\": 4503599627370496,\n \"document\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"conversation\": {\n \"entry_node_id\": \"<string>\",\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"conversation\",\n \"instructions\": \"<string>\",\n \"available_binding_ids\": [\n \"<string>\"\n ],\n \"binding_overrides\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"kind\": \"conversation\",\n \"condition\": \"<string>\"\n }\n ],\n \"global_edges\": [\n {\n \"id\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ]\n },\n \"schema_version\": \"1\",\n \"strict_mode\": false,\n \"global_instructions\": \"\",\n \"channels\": [],\n \"request_schema\": {},\n \"stored_schema\": {},\n \"bindings\": [\n {\n \"id\": \"<string>\",\n \"tool_revision_id\": \"<string>\",\n \"tool_revision_policy\": \"follow_current\",\n \"inputs\": {}\n }\n ],\n \"before\": {\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"on_failure\": \"stop_admission\"\n },\n \"after\": [\n {\n \"id\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n }\n }\n ],\n \"sequences\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"description\": \"\",\n \"input_schema\": {},\n \"output_schema\": {},\n \"output_mapping\": {}\n }\n ],\n \"editor\": {\n \"positions\": {}\n },\n \"integrations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"app\": \"<string>\",\n \"actions\": [\n {\n \"action\": \"<string>\",\n \"binding_id\": \"<string>\"\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.goyappr.com/agents/{id}/workflow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 4503599627370496,\n \"document\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"conversation\": {\n \"entry_node_id\": \"<string>\",\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"conversation\",\n \"instructions\": \"<string>\",\n \"available_binding_ids\": [\n \"<string>\"\n ],\n \"binding_overrides\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"kind\": \"conversation\",\n \"condition\": \"<string>\"\n }\n ],\n \"global_edges\": [\n {\n \"id\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ]\n },\n \"schema_version\": \"1\",\n \"strict_mode\": false,\n \"global_instructions\": \"\",\n \"channels\": [],\n \"request_schema\": {},\n \"stored_schema\": {},\n \"bindings\": [\n {\n \"id\": \"<string>\",\n \"tool_revision_id\": \"<string>\",\n \"tool_revision_policy\": \"follow_current\",\n \"inputs\": {}\n }\n ],\n \"before\": {\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"on_failure\": \"stop_admission\"\n },\n \"after\": [\n {\n \"id\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n }\n }\n ],\n \"sequences\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"description\": \"\",\n \"input_schema\": {},\n \"output_schema\": {},\n \"output_mapping\": {}\n }\n ],\n \"editor\": {\n \"positions\": {}\n },\n \"integrations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"app\": \"<string>\",\n \"actions\": [\n {\n \"action\": \"<string>\",\n \"binding_id\": \"<string>\"\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 4503599627370496,\n \"document\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"conversation\": {\n \"entry_node_id\": \"<string>\",\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"conversation\",\n \"instructions\": \"<string>\",\n \"available_binding_ids\": [\n \"<string>\"\n ],\n \"binding_overrides\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"kind\": \"conversation\",\n \"condition\": \"<string>\"\n }\n ],\n \"global_edges\": [\n {\n \"id\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ]\n },\n \"schema_version\": \"1\",\n \"strict_mode\": false,\n \"global_instructions\": \"\",\n \"channels\": [],\n \"request_schema\": {},\n \"stored_schema\": {},\n \"bindings\": [\n {\n \"id\": \"<string>\",\n \"tool_revision_id\": \"<string>\",\n \"tool_revision_policy\": \"follow_current\",\n \"inputs\": {}\n }\n ],\n \"before\": {\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"on_failure\": \"stop_admission\"\n },\n \"after\": [\n {\n \"id\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n }\n }\n ],\n \"sequences\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"description\": \"\",\n \"input_schema\": {},\n \"output_schema\": {},\n \"output_mapping\": {}\n }\n ],\n \"editor\": {\n \"positions\": {}\n },\n \"integrations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"app\": \"<string>\",\n \"actions\": [\n {\n \"action\": \"<string>\",\n \"binding_id\": \"<string>\"\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_version": "legacy",
"draft": {
"version": 2,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": [
"<string>"
],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": false,
"global_instructions": "",
"channels": [
"phone"
],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"event": "call.answered",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": {
"positions": {}
},
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
},
"updated_at": "2023-11-07T05:31:56Z"
},
"published": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 2,
"content_hash": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"environment": "local"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Save workflow draft
Save one Before, During and After document with optimistic concurrency.
curl --request PUT \
--url https://api.goyappr.com/agents/{id}/workflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 4503599627370496,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": [
"<string>"
],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": false,
"global_instructions": "",
"channels": [],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": {
"positions": {}
},
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
}
}
'import requests
url = "https://api.goyappr.com/agents/{id}/workflow"
payload = {
"expected_version": 4503599627370496,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": ["<string>"],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": False,
"global_instructions": "",
"channels": [],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": ["<string>"],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": ["<string>"],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": ["<string>"],
"requires": [],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": True
},
"value": {
"kind": "literal",
"value": True
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": { "positions": {} },
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 4503599627370496,
document: {
id: '<string>',
name: '<string>',
conversation: {
entry_node_id: '<string>',
nodes: [
{
id: '<string>',
label: '<string>',
type: 'conversation',
instructions: '<string>',
available_binding_ids: ['<string>'],
binding_overrides: {}
}
],
edges: [
{
id: '<string>',
source: '<string>',
target: '<string>',
kind: 'conversation',
condition: '<string>'
}
],
global_edges: [{id: '<string>', target: '<string>', condition: '<string>'}]
},
schema_version: '1',
strict_mode: false,
global_instructions: '',
channels: [],
request_schema: {},
stored_schema: {},
bindings: [
{
id: '<string>',
tool_revision_id: '<string>',
tool_revision_policy: 'follow_current',
inputs: {}
}
],
before: {
steps: [
{
id: '<string>',
label: '<string>',
binding_id: '<string>',
depends_on: ['<string>'],
requires: [],
on_failure: 'stop',
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
},
on_succeeded: '<string>',
on_failed: '<string>'
}
],
on_failure: 'stop_admission'
},
after: [
{
id: '<string>',
steps: [
{
id: '<string>',
label: '<string>',
binding_id: '<string>',
depends_on: ['<string>'],
requires: [],
on_failure: 'stop',
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
},
on_succeeded: '<string>',
on_failed: '<string>'
}
],
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
}
}
],
sequences: [
{
id: '<string>',
name: '<string>',
steps: [
{
id: '<string>',
label: '<string>',
binding_id: '<string>',
depends_on: ['<string>'],
requires: [],
on_failure: 'stop',
when: {
kind: 'compare',
source: {kind: 'literal', value: true},
value: {kind: 'literal', value: true}
},
on_succeeded: '<string>',
on_failed: '<string>'
}
],
description: '',
input_schema: {},
output_schema: {},
output_mapping: {}
}
],
editor: {positions: {}},
integrations: [
{
id: '<string>',
connection_id: '<string>',
app: '<string>',
actions: [{action: '<string>', binding_id: '<string>'}]
}
]
}
})
};
fetch('https://api.goyappr.com/agents/{id}/workflow', 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.goyappr.com/agents/{id}/workflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 4503599627370496,
'document' => [
'id' => '<string>',
'name' => '<string>',
'conversation' => [
'entry_node_id' => '<string>',
'nodes' => [
[
'id' => '<string>',
'label' => '<string>',
'type' => 'conversation',
'instructions' => '<string>',
'available_binding_ids' => [
'<string>'
],
'binding_overrides' => [
]
]
],
'edges' => [
[
'id' => '<string>',
'source' => '<string>',
'target' => '<string>',
'kind' => 'conversation',
'condition' => '<string>'
]
],
'global_edges' => [
[
'id' => '<string>',
'target' => '<string>',
'condition' => '<string>'
]
]
],
'schema_version' => '1',
'strict_mode' => false,
'global_instructions' => '',
'channels' => [
],
'request_schema' => [
],
'stored_schema' => [
],
'bindings' => [
[
'id' => '<string>',
'tool_revision_id' => '<string>',
'tool_revision_policy' => 'follow_current',
'inputs' => [
]
]
],
'before' => [
'steps' => [
[
'id' => '<string>',
'label' => '<string>',
'binding_id' => '<string>',
'depends_on' => [
'<string>'
],
'requires' => [
],
'on_failure' => 'stop',
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
],
'on_succeeded' => '<string>',
'on_failed' => '<string>'
]
],
'on_failure' => 'stop_admission'
],
'after' => [
[
'id' => '<string>',
'steps' => [
[
'id' => '<string>',
'label' => '<string>',
'binding_id' => '<string>',
'depends_on' => [
'<string>'
],
'requires' => [
],
'on_failure' => 'stop',
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
],
'on_succeeded' => '<string>',
'on_failed' => '<string>'
]
],
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
]
]
],
'sequences' => [
[
'id' => '<string>',
'name' => '<string>',
'steps' => [
[
'id' => '<string>',
'label' => '<string>',
'binding_id' => '<string>',
'depends_on' => [
'<string>'
],
'requires' => [
],
'on_failure' => 'stop',
'when' => [
'kind' => 'compare',
'source' => [
'kind' => 'literal',
'value' => true
],
'value' => [
'kind' => 'literal',
'value' => true
]
],
'on_succeeded' => '<string>',
'on_failed' => '<string>'
]
],
'description' => '',
'input_schema' => [
],
'output_schema' => [
],
'output_mapping' => [
]
]
],
'editor' => [
'positions' => [
]
],
'integrations' => [
[
'id' => '<string>',
'connection_id' => '<string>',
'app' => '<string>',
'actions' => [
[
'action' => '<string>',
'binding_id' => '<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.goyappr.com/agents/{id}/workflow"
payload := strings.NewReader("{\n \"expected_version\": 4503599627370496,\n \"document\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"conversation\": {\n \"entry_node_id\": \"<string>\",\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"conversation\",\n \"instructions\": \"<string>\",\n \"available_binding_ids\": [\n \"<string>\"\n ],\n \"binding_overrides\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"kind\": \"conversation\",\n \"condition\": \"<string>\"\n }\n ],\n \"global_edges\": [\n {\n \"id\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ]\n },\n \"schema_version\": \"1\",\n \"strict_mode\": false,\n \"global_instructions\": \"\",\n \"channels\": [],\n \"request_schema\": {},\n \"stored_schema\": {},\n \"bindings\": [\n {\n \"id\": \"<string>\",\n \"tool_revision_id\": \"<string>\",\n \"tool_revision_policy\": \"follow_current\",\n \"inputs\": {}\n }\n ],\n \"before\": {\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"on_failure\": \"stop_admission\"\n },\n \"after\": [\n {\n \"id\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n }\n }\n ],\n \"sequences\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"description\": \"\",\n \"input_schema\": {},\n \"output_schema\": {},\n \"output_mapping\": {}\n }\n ],\n \"editor\": {\n \"positions\": {}\n },\n \"integrations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"app\": \"<string>\",\n \"actions\": [\n {\n \"action\": \"<string>\",\n \"binding_id\": \"<string>\"\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.goyappr.com/agents/{id}/workflow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 4503599627370496,\n \"document\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"conversation\": {\n \"entry_node_id\": \"<string>\",\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"conversation\",\n \"instructions\": \"<string>\",\n \"available_binding_ids\": [\n \"<string>\"\n ],\n \"binding_overrides\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"kind\": \"conversation\",\n \"condition\": \"<string>\"\n }\n ],\n \"global_edges\": [\n {\n \"id\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ]\n },\n \"schema_version\": \"1\",\n \"strict_mode\": false,\n \"global_instructions\": \"\",\n \"channels\": [],\n \"request_schema\": {},\n \"stored_schema\": {},\n \"bindings\": [\n {\n \"id\": \"<string>\",\n \"tool_revision_id\": \"<string>\",\n \"tool_revision_policy\": \"follow_current\",\n \"inputs\": {}\n }\n ],\n \"before\": {\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"on_failure\": \"stop_admission\"\n },\n \"after\": [\n {\n \"id\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n }\n }\n ],\n \"sequences\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"description\": \"\",\n \"input_schema\": {},\n \"output_schema\": {},\n \"output_mapping\": {}\n }\n ],\n \"editor\": {\n \"positions\": {}\n },\n \"integrations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"app\": \"<string>\",\n \"actions\": [\n {\n \"action\": \"<string>\",\n \"binding_id\": \"<string>\"\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 4503599627370496,\n \"document\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"conversation\": {\n \"entry_node_id\": \"<string>\",\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"conversation\",\n \"instructions\": \"<string>\",\n \"available_binding_ids\": [\n \"<string>\"\n ],\n \"binding_overrides\": {}\n }\n ],\n \"edges\": [\n {\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"kind\": \"conversation\",\n \"condition\": \"<string>\"\n }\n ],\n \"global_edges\": [\n {\n \"id\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n }\n ]\n },\n \"schema_version\": \"1\",\n \"strict_mode\": false,\n \"global_instructions\": \"\",\n \"channels\": [],\n \"request_schema\": {},\n \"stored_schema\": {},\n \"bindings\": [\n {\n \"id\": \"<string>\",\n \"tool_revision_id\": \"<string>\",\n \"tool_revision_policy\": \"follow_current\",\n \"inputs\": {}\n }\n ],\n \"before\": {\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"on_failure\": \"stop_admission\"\n },\n \"after\": [\n {\n \"id\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n }\n }\n ],\n \"sequences\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"binding_id\": \"<string>\",\n \"depends_on\": [\n \"<string>\"\n ],\n \"requires\": [],\n \"on_failure\": \"stop\",\n \"when\": {\n \"kind\": \"compare\",\n \"source\": {\n \"kind\": \"literal\",\n \"value\": true\n },\n \"value\": {\n \"kind\": \"literal\",\n \"value\": true\n }\n },\n \"on_succeeded\": \"<string>\",\n \"on_failed\": \"<string>\"\n }\n ],\n \"description\": \"\",\n \"input_schema\": {},\n \"output_schema\": {},\n \"output_mapping\": {}\n }\n ],\n \"editor\": {\n \"positions\": {}\n },\n \"integrations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"app\": \"<string>\",\n \"actions\": [\n {\n \"action\": \"<string>\",\n \"binding_id\": \"<string>\"\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_version": "legacy",
"draft": {
"version": 2,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": [
"<string>"
],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": false,
"global_instructions": "",
"channels": [
"phone"
],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"event": "call.answered",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": {
"positions": {}
},
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
},
"updated_at": "2023-11-07T05:31:56Z"
},
"published": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 2,
"content_hash": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"environment": "local"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}agents:update. Saving never publishes or executes an action.
id and name back exactly as the read returned them: both are set
by Yappr, and a save that changes either is refused. Rename the agent with
PATCH /agents/{id}.curl -X PUT 'https://api.goyappr.com/agents/AGENT_ID/workflow' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-company-id: COMPANY_ID' \
-H 'Content-Type: application/json' \
--data-binary @workflow-save.json
workflow-save.json contains expected_version and document as JSON values,
not a stringified document. The response is the updated authoring state and new
draft version.
A save either lands whole or writes nothing. 409 WORKFLOW_CONFLICT is the
second case: the draft is exactly what it was before the request, so read the
latest draft and reconcile your change into it. Do not automatically replace a
newer draft.
Re-sending a save is safe. If the answer to a save never reaches you — a
dropped connection, a timeout, a process that died mid-request — send the same
expected_version and the same document again. If the first attempt had
landed and nothing has been saved since, the draft already is that document and
the retry answers 200 with it, not 409; if it had not, the retry saves it.
The replay is recognised only while the draft is still your document at exactly
expected_version + 1. If somebody else saved on top of your lost write, the
retry is an ordinary 409. So on a 409, read the latest draft before assuming
your change was lost — it may already be in there.
The UTF-8 request body must fit 600,000 bytes; PostgreSQL’s stored document
representation must fit 512 KiB. 413 retains the previous saved state. Use a
lossless client so false, zero, null, missing fields and exact numbers survive.
The document supports Before dependencies and failure policy; During
conversation/tool/sequence nodes and global exits; After event/artifact
dependencies; full request/stored schemas; typed source mappings and explicit
missing-value fallbacks. Only During may collect values from the model.
Those source mappings live in bindings[].inputs, and they are where a tool’s
arguments come from:
How a tool gets its arguments writes out every source
kind, when each one applies, and links a complete document that uses all of
them. One is worked end to end below.
Refusals name the field
A refused save carriesissues[] in the same shape Check uses — code, path, message —
and error repeats the first message. A path to a request field names the field; a path into
the document starts at the document.
| Refusal | issues[].path |
|---|---|
400 WORKFLOW_REQUEST_INVALID, expected_version missing or not a whole number | /expected_version |
400 WORKFLOW_REQUEST_INVALID, a field the save does not read | /<field> |
422 WORKFLOW_DOCUMENT_INVALID, no document | /document |
422 WORKFLOW_REFERENCE_INVALID, a binding’s revision is not usable here | /bindings/<n>/tool_revision_id |
422 WORKFLOW_DOCUMENT_INVALID, a step kind the schema does not have (node_type_unknown) | /conversation/nodes/<n>/type |
422 WORKFLOW_DOCUMENT_INVALID, a step without a member its kind requires (field_required) | /after/0/steps/0/label, /conversation/nodes/<n>/instructions, … |
422 WORKFLOW_DOCUMENT_INVALID, a changed id or name (server_owned) | /id, /name |
422 WORKFLOW_DOCUMENT_INVALID, an After trigger’s event that is not one of the events (event_unknown); a legacy webhook name such as call.analyzed is told the trigger it became (analysis.ready) | /after/<n>/event |
422 WORKFLOW_DOCUMENT_INVALID, a binding input its tool does not have (unknown_input), or a stored source reading a path the document’s stored_schema does not declare (unknown_source_path) | /bindings/<n>/inputs/<field> |
422 WORKFLOW_DOCUMENT_INVALID, a calendar fixed on an agent-wide action whose managed tool was set up before it could take one (config_input_needs_update): send POST /tool-connections/{id}/actions/prepare with {"actions":["<slug>"]} and save again, or set it with PATCH /agents/{id}/integrations/{integration_id}, which updates the tool first | /bindings/<n>/inputs/<field> |
422 RESERVED_BINDING_ID, a binding id of the reserved shapes t_<hex> or o_<letters and digits> that no tool for every step and no step’s own settings owns: those ids are kept for Tools & integrations, so rename it | /bindings/<n>/id |
422 WORKFLOW_DOCUMENT_INVALID, a fallback that is not {"value": …} or null — a bare string, for one (field_invalid) | /bindings/<n>/inputs/<field>/fallback |
422 WORKFLOW_DOCUMENT_INVALID, an action step’s hold_line that is not text of 1 to 28 characters (field_invalid), with the step in node_id and label — see A line said while a step’s tool runs | /conversation/nodes/<n>/hold_line |
node_id and
label, the step’s own label — the tool in tool_name, and the input in
field, as Check does.
What a save refuses
A save and Check divide the work in one way, on every route that saves:- The save refuses the document’s shape. What the
workflow schema requires of each part — a step
kind it has (
conversation,action,sequence,end), and every member that kind needs, such as thelabelevery step carries, and an After trigger’seventfrom the event list, and an action step’shold_lineof 1 to 28 characters — plus a change to the server-ownedidorname, and a binding whose tool revision this workspace cannot use — and a binding that can never work: an input its tool does not have, or astoredsource reading a pathstored_schemadoes not declare. Every problem is named in the one answer, by path,erroris the first with how many more follow, and nothing is written. - Check and publish refuse what only the whole graph can tell. A step
nothing reaches, a transition to a step that does not exist, a tool wired into
a phase it cannot run in, an input reading a detail the agent does not
collect, the phase rules below. A draft is allowed to be unfinished, so these
save, and Check names each of them with
422 WORKFLOW_VALIDATION_FAILED.
tool_revision_id. That issue has the
code reference_is_tool_id, and its message names the revision to send instead —
workflow.head_revision_id from Get tool. When the same save also
has a shape or binding problem, it is named in that one 422 WORKFLOW_DOCUMENT_INVALID
beside them — an unknown_input on one binding and a tool id on another come back together,
not one per save.
A binding to a tool that has since been archived is tool_archived at
/bindings/<n>/tool_revision_id, with the step that runs it in node_id and label (the message
names every step that shares the binding) and the tool in tool_name. Restore the tool with
POST /tools/{id}/restore — the message carries its id — or remove
the step; rebinding is not the fix. An app tool whose connected account is no longer connected is
connection_unavailable there, the same way.
A complete minimal save
This is the whole body of a save that Check accepts — every field, nothing elided. It gives an agent one tool and lets the conversation use it. Read the draft first;expected_version is the draft.version that read returned, and
everything under document is that draft with two edits: one entry in
bindings, and that entry’s id in the conversation node’s
available_binding_ids.
{
"expected_version": 1,
"document": {
"id": "AGENT_ID",
"name": "Order desk",
"schema_version": "1",
"channels": ["phone", "web"],
"global_instructions": "You look up an order for the caller and read back its status.",
"request_schema": { "type": "object", "properties": {} },
"stored_schema": { "type": "object", "properties": {} },
"bindings": [
{
"id": "lookup-order",
"tool_revision_id": "TOOL_REVISION_ID",
"inputs": { "order_id": { "kind": "model", "path": "/order_id" } }
}
],
"before": { "steps": [], "on_failure": "stop_admission" },
"after": [],
"sequences": [],
"conversation": {
"entry_node_id": "conversation_1",
"nodes": [
{
"id": "conversation_1",
"type": "conversation",
"label": "Conversation",
"instructions": "Ask for the order number, then look it up and read back its status.",
"available_binding_ids": ["lookup-order"]
},
{ "id": "end", "type": "end", "label": "End call" }
],
"edges": [
{
"id": "conversation_complete",
"kind": "conversation",
"source": "conversation_1",
"target": "end",
"condition": "The caller has the status and has no further questions."
}
],
"global_edges": []
},
"strict_mode": false
}
}
TOOL_REVISION_ID is the id of a row from
GET /tools/workflow-catalog — the
revision id, not the tool id — and order_id is a field name out of that same
row’s input_schema. {"kind":"model","path":"/order_id"} means the agent
asks the caller for it during the conversation; path is one top-level field
name with a leading slash, never a deeper pointer.
The save answers 200 with the new draft.version. Check that version:
curl -X POST 'https://api.goyappr.com/agents/AGENT_ID/workflow/validate' \
-H 'Authorization: Bearer YOUR_API_KEY' -H 'x-company-id: COMPANY_ID' \
-H 'Content-Type: application/json' --data '{"expected_version":2}'
{ "valid": true, "content_hash": "39463e82…", "issues": [], "warnings": [{ "code": "strict_off_guidance" }] }
environment — testing on the hosted
API. It is the deployment plane that stored the version, not a staging copy and
not something you send: you publish and place calls through the same deployment,
so the version you just published is the version your next call runs. See
What environment says, and what it does not.
Staging a value a follow-up needs
A{"kind":"model"} source is the one thing this example cannot be copied into
a follow-up. Move that binding under after unchanged and Check refuses it:
{
"code": "model_input_unavailable",
"path": "/bindings/0/inputs/order_id",
"node_id": "notify",
"message": "Only the conversation can collect a value from the caller, so a before-call step, a follow-up step or a step inside a sequence cannot read a model source. Read a request, stored, step or artifact source instead."
}
request (declare it in request_schema and
send it on POST /calls), step (an output another step produced) or
artifact (a produced result such as the transcript or the analysis, with the
same name in the step’s requires). There is a fourth kind, stored, and it
is the one to avoid: nothing writes saved context, so the input arrives empty on
every call. The save keeps such a draft, but Check and publish refuse a
required input whose only source is stored (no fallback) with
stored_context_has_no_writer, and flag an optional one as an advisory. The
same document Checks clean once the follow-up’s binding reads the value the
call was started with — declared in request_schema and sent in variables
on POST /calls:
{
"request_schema": { "type": "object", "properties": { "order_id": { "type": "string" } } },
"after": [
{
"id": "follow-up",
"event": "call.ended",
"steps": [{ "id": "notify", "label": "Post the order to the desk", "binding_id": "post-summary" }]
}
],
"bindings": [
{
"id": "post-summary",
"tool_revision_id": "TOOL_REVISION_ID",
"inputs": { "order_id": { "kind": "request", "path": "/order_id" } }
}
]
}
Sending what the agent extracted
The values the agent was asked to pick out of the conversation are theanalysis artifact’s extracted_data, so a follow-up hands them to a tool with
an ordinary artifact source — one field, or the whole set:
{
"after": [
{
"id": "tell-the-crm",
"event": "call.ended",
"steps": [{ "id": "notify", "label": "Post what we collected", "binding_id": "notify-crm", "requires": ["analysis"] }]
}
],
"bindings": [
{
"id": "notify-crm",
"tool_revision_id": "TOOL_REVISION_ID",
"inputs": {
"preferred_day": { "kind": "artifact", "artifact": "analysis", "path": "/extracted_data/preferred_day" },
"collected": { "kind": "artifact", "artifact": "analysis", "path": "/extracted_data" }
}
}
]
}
/extracted_data/<the name you gave the parameter>, and
every parameter the agent collects is a key on every call — one the conversation
never covered is stored as null. The pointer resolves, so a fallback on that
source never fires: an input reading a single extracted field needs a type that
accepts null ("type": ["string", "null"]), or the step fails on any call that
did not cover it. Reading the whole /extracted_data object into one object
input avoids the question. The same artifact carries /summary and
/disposition_id, written by the same post-call pass —
Tool inputs lists every artifact’s payload.
Check and publish read every
/extracted_data/<name> against the agent’s extraction parameters: a name the
agent does not collect is extracted_field_unknown, and a parameter whose kind
the input’s type cannot take — a yes_no into a "string" input, a text
into a "boolean" one — is extracted_field_type_mismatch. Both name the input.
Reading a value by description
When no extraction parameter exists for what a follow-up needs — the time slot the caller agreed to, for a calendar event — describe it on the input itself. This books the event at the time the caller agreed to, and does nothing if the call never settled on one:{
"after": [
{
"id": "book-after-call",
"event": "call.ended",
"steps": [{ "id": "book", "label": "Put the visit in the calendar", "binding_id": "calendar-event" }]
}
],
"bindings": [
{
"id": "calendar-event",
"tool_revision_id": "TOOL_REVISION_ID",
"inputs": {
"summary": { "kind": "literal", "value": "Visit" },
"start_datetime": { "kind": "extract", "instruction": "the time slot the caller agreed to" },
"end_datetime": { "kind": "extract", "instruction": "the time it ends, only if the caller named an end time later than the start" }
}
}
]
}
requires needed). Add
"on_missing": "fail" to make a call with no agreed time fail the step instead
of skipping it, or "fallback": {"value": "2026-11-04T09:00:00+02:00"} to book a
default; they are not written together. The required start_datetime skips the
step when the call did not say it; the optional end_datetime is left out and
the calendar’s own default length applies. Every member and rule is in
Tool inputs.
Check names what cannot work: extract_unavailable_phase (not a follow-up step),
extract_type_unsupported (the input cannot take a description),
extract_missing_policy, extract_instruction_empty, and extract_unavailable
while the workspace’s voice engine does not read it yet. A save keeps the draft
and checks only that a fallback is shaped {"value": …}. The call’s timeline
shows what each step read, and a skipped step with the reason.
Tool sequences contain tool-only private children with one public input/output
contract. They cannot recursively nest or automatically group conversation
nodes. Keep intrinsic End; named transfer destinations belong to saved Tools.
Draft saving checks shape and company references (What a save
refuses). Executable graph validation is performed by
Check workflow and again by
Publish.
Follow-up triggers
An After trigger names one event and matches it exactly: a follow-up oncall.ended does not run for a call that failed or that nobody answered. Two of
the events you can author stand for more than one runtime event.
any_endis every way a call can stop — it coverscall.ended,call.failedandcall.no_answer. Use it for a follow-up that must run whatever the ending, and leave its steps’requiresempty: it includes the call nobody answered, which never has a transcript, analysis, recording, lead or billing. Check warns withafter_any_end_waitswhen a step on it waits for any of them.request.failedis the request itself dying before anything was dialled. No call exists and no call event is published, so this is the only trigger that runs for it.call.answeredis the call being picked up: the leg answered on a phone call, the browser peer accepted on a web call. It is the one event published at the start of a call, so its follow-up runs while the conversation is still going. It is deliberately not part ofany_end— a trigger on however the call ends never fires on a pickup, and one oncall.answerednever fires on an ending.
call.answered runs on the follow-up lane like every other one,
beside the live conversation rather than in front of it: nothing it does delays
the conversation, and the agent never waits on it. Its steps receive the call
package at "phase": "after", but the call has not ended, so the ended-call
members — ended_at, duration_seconds, transcript, analysis,
recording_url — are absent rather than empty. status is always present and
reads the live state (ringing, in_progress), so it is not the signal that a
call has stopped. Wait for the event that names the result you need.
A trigger that waits for a result — transcript.ready, analysis.ready,
recording.ready, lead.ready, billing.ready — starts its follow-up only for
a result that was actually produced. A call nobody answered settles those
producers without producing anything, and a follow-up waiting on one of them
does not start at all.
The full set of events a trigger accepts is the event enum of the
canonical workflow document.
A trigger is an id, an event and its steps, and every step needs a
label — the same three-field shape (id, label, binding_id) a
before-call step and a sequence child use. A step written without one is
refused by the save, 422 WORKFLOW_DOCUMENT_INVALID with issues[0].path
/after/0/steps/0/label (the trigger’s and the step’s positions), and nothing
is written:
{
"after": [
{
"id": "summary-to-clinic",
"event": "call.ended",
"steps": [
{
"id": "email",
"label": "Email the clinic the call summary",
"binding_id": "email-summary",
"requires": ["transcript"],
"on_failure": "continue"
}
]
},
{
"id": "missed-call",
"event": "call.no_answer",
"steps": [
{
"id": "text-clinic",
"label": "Text the clinic that a call went unanswered",
"binding_id": "missed-call-sms",
"on_failure": "continue"
}
]
}
]
}
requires names the produced results this step waits for, so the step starts
only once they exist. A step can wait only for what its event can have — a
finished call (call.ended) can have all five, a call nobody answered none — and
Trigger events lists
them event by event. A step that waits for something its event never has is
refused at Check and publish with artifact_never_produced. Reading a result
with an artifact source adds the same wait on its own — see
How a tool gets its arguments.
A different follow-up for each ending
A call stops one of three ways, and each way leaves the call with different things to say. So the way to do something different per ending is one follow-up per ending, each with its own steps:| You want | Add a follow-up on | Its steps can wait for |
|---|---|---|
| Text someone when nobody answered | call.no_answer | nothing |
| Report a call that failed | call.failed | nothing |
| Send the summary when the call finished | call.ended | transcript, analysis, recording, lead, billing |
| Act on what the AI concluded | analysis.ready | transcript, recording, lead, billing |
| Tell your system that a call request died before dialling | request.failed | nothing |
- Every follow-up whose event matches, and whose “Only if” holds, runs.
any_endpluscall.no_answeron one agent both run when nobody answers, so a team gets two messages. Useany_endalone, or the specific endings alone; mix them only when both should run. The dashboard says so when it sees the mix. - A condition belongs to the follow-up, not to its steps. A step on a follow-up
cannot carry
when; give the follow-up an “Only if” instead (how). “If interested, book a call; otherwise nothing” is a follow-up onanalysis.readywith an “Only if” on the disposition. The disposition is guaranteed onanalysis.readyonly; on the ending events it is written a moment after them.
any_end. Put the step on analysis.ready (or
call.ended), and give the unanswered call its own follow-up on
call.no_answer with steps that wait for nothing.
Running a follow-up only for some calls
A trigger can carry one optionalwhen: an Only if over facts about the
call. The follow-up opens as before, the condition is decided once, and when it
does not hold every step of the follow-up is recorded as skipped (guard_false)
and the follow-up counts as done — it is not a failure and sends nothing.
Every follow-up whose event and condition match runs; there is no implicit
“otherwise”.
when is the same condition a sequence step uses — compare, all_of, any_of
and not, up to 4 levels and 32 parts — over a new read-only source,
{"kind": "call", "path": "/status"}, compared with a fixed literal:
{
"id": "nobody-answered",
"event": "any_end",
"when": {
"kind": "all_of",
"conditions": [
{ "kind": "compare", "source": { "kind": "call", "path": "/status" }, "op": "eq", "value": { "kind": "literal", "value": "no_answer" } },
{ "kind": "compare", "source": { "kind": "call", "path": "/call_direction" }, "op": "eq", "value": { "kind": "literal", "value": "outbound" } }
]
},
"steps": [{ "id": "text-the-team", "label": "Text the team", "binding_id": "sms" }]
}
What each event lets you read
A fact is offered only where the event guarantees it, because the condition is read from the call as it is when the follow-up opens. An event that cannot guarantee a fact is refused at Check withtrigger_filter_unavailable, naming the field, the event and where to move it.
| Fact | path | Values | Readable on |
|---|---|---|---|
| Result | /status | completed, no_answer, failed | any_end only: the other endings already say it |
| Who ended it | /ended_by | caller, agent, system, operator | any_end, call.ended, call.failed, call.no_answer |
| Duration | /duration_seconds | number of seconds | the same four endings |
| Direction | /call_direction | inbound, outbound (a browser call is neither: use Channel) | every event except request.failed |
| Channel | /channel | phone, web | every event |
| Disposition | /disposition/id, /disposition/label | one of the company’s dispositions | analysis.ready only |
| Collected field | /analysis/extracted_data/<name> | what the agent collected, as text | analysis.ready only |
analysis.ready; at the ending events they are still being written, so they are
not offered there. ai_session.ended is not an ending — it can fire before the
carrier’s hangup is saved, or long before a transferred call ends — so it
offers direction and channel only.
A fact the call does not have yet makes its comparison false, never an error:
ended_by is sometimes not reported, and a call can have no disposition.
exists and not_exists test for that directly.
The condition is decided before any step: a follow-up it skips never asks the call
for a value, and a follow-up it lets through whose step reads a value
by description and finds none skips only that step (its
follow-up still counts as done).
The opposite follow-up
To do something else with every other call, add a second follow-up on the same event whosewhen is {"kind": "not", "condition": <the first one's when>}. The
dashboard’s Add the opposite builds exactly that. Because a missing fact
makes a comparison false, the not(...) follow-up also runs when the fact is
missing, so the two together cover every call that reached the event:
{ "id": "others", "event": "any_end", "when": { "kind": "not", "condition": { "kind": "compare", "source": { "kind": "call", "path": "/status" }, "op": "eq", "value": { "kind": "literal", "value": "no_answer" } } }, "steps": [] }
analysis.ready only ever sees calls whose
analysis finished. A call whose analysis never settled opens no
analysis.ready follow-up at all, so even a not(...) sibling on that event
does not catch it. To cover those too, put a plain follow-up on call.ended or
any_end that needs no analysis.
when is compiler_version 1.9.0: a document without one compiles to exactly
the bytes it did before, and a voice engine older than 1.9.0 refuses a document
with one at Check (trigger_filter_reader_unavailable). The dashboard shows a
follow-up the condition skipped as Skipped: the condition was not met, with
the values it saw, and GET /calls/{id} lists it
under follow_ups as reason: "condition_not_met".
Routing on what a tool answered
A tool step (anaction node, or a sequence node) leaves by result edges:
succeeded when the tool did its job and failed when it did not. When the next
step depends on what the tool answered — an availability check that says
book, offer_other_time or transfer — put a when on the succeeded edge
for each answer, and one succeeded edge without a when for every other
answer. The platform reads the answer and takes the edge, with no model in
between, so the same answer always leads to the same step. These are the
strict_mode and conversation.edges of a document where check is an
action node whose tool answers with a route:
{
"strict_mode": true,
"conversation": {
"edges": [
{
"id": "check-book", "source": "check", "target": "confirm-time",
"kind": "result", "outcome": "succeeded",
"when": {
"kind": "compare", "op": "eq",
"source": { "kind": "step", "scope": "during", "step_id": "check", "path": "/route" },
"value": { "kind": "literal", "value": "book" }
}
},
{
"id": "check-transfer", "source": "check", "target": "hand-over",
"kind": "result", "outcome": "succeeded",
"when": {
"kind": "compare", "op": "in",
"source": { "kind": "step", "scope": "during", "step_id": "check", "path": "/route" },
"value": { "kind": "literal", "value": ["transfer", "urgent"] }
}
},
{ "id": "check-otherwise", "source": "check", "target": "offer-other-time", "kind": "result", "outcome": "succeeded" },
{ "id": "check-failed", "source": "check", "target": "apologise", "kind": "result", "outcome": "failed" }
]
}
}
check-otherwise is the otherwise edge: the one succeeded edge with no
when. It is taken when no when holds, for example when /route is "full"
or the answer has no route at all.
How it is decided:
- Same conditions as a sequence step.
whenis acompare,all_of,any_ofornot, with the same operators, limits and no-coercion rules as Branching inside a sequence. - It reads two things only: fixed values (
literal), and the answer of the step the edge leaves, as{"kind": "step", "scope": "during", "step_id": "<the edge's source>", "path": "/<field>"}. For a sequence step the answer is the sequence’s output. A request value, a stored value, the call or another step’s answer cannot be read here. - Inside a list. A
pathmay step into a list by position:/data/trips/0/distanceis the distance of the first trip. A position is a whole number written without a leading zero (0,1,12; notfirst,-1or01). A list the tool marks optional ("type": ["array", "null"], how connected-app tools declare most lists) is read the same way. If the list isnull, empty, missing or shorter than the position, or the field in it is missing, the comparison is false and the next edge is tried; it does not fail the call./data/trips/0reads the first trip; there is no “any item” or “last item”. - In the order written. The edges with a
whenare tried in the order they appear inconversation.edges, and the first that holds is taken. Put the most specific one first. - Exactly one otherwise edge. A step with any
whenneeds onesucceedededge without one. Two without are still ambiguous, and so are twofailededges. - Success only, and Strict only. A
failededge never has awhen: it is taken whenever the tool fails, whatever it answered. Awhenneedsstrict_mode: true, because only Strict mode holds the conversation to the edge the answer picked. - A comparison that cannot be made is false. If the answer has no such field, or the value is not the type the comparison expects, that comparison is false and the next edge is tried. It does not fail the call.
- A tool that never answered (a timeout, a connection that reset) takes the
step’s
failededge, with or without awhenon the step, and the request is not sent again. A step with nofailededge waits. A call transfer is the exception: if the carrier never said whether it connected, the call waits, because the caller may already be on the other line. A transfer the carrier refuses takes itsfailededge like any other step. - A step without a
whenis routed bysucceededorfailedexactly as before.
"0" and 0 are different values, so list both
({"op": "in", "value": {"kind": "literal", "value": ["0", 0]}}) when an
endpoint may send either.
A not turns the false of a comparison that cannot be made into true. not around gt 8000 on
/data/trips/0/distance also holds when the answer has no trip, or when the trip has no distance, so write the
comparison the way you mean it. “There is a trip and it is not long” is lte 8000, which is false whenever
there is no distance to read:
"when": {
"kind": "compare", "op": "lte",
"source": { "kind": "step", "scope": "during", "step_id": "route", "path": "/data/trips/0/distance" },
"value": { "kind": "literal", "value": 8000 }
}
gt and lte, gte and lt). exists is true for a
position that holds null, so all_of of exists on the trip and a not still holds for a trip whose distance is
null or missing. not_exists is true when the position is not there: a null, empty or shorter list.
Check refuses the mistakes, each at the edge or the step it concerns:
| Code | What to change |
|---|---|
result_guard_outcome | A when on a failed edge. Remove it. |
result_guard_needs_strict | A when while strict_mode is off. Turn Strict mode on, or remove the when. |
result_guard_needs_otherwise | The step has succeeded edges with a when and none without. Add the otherwise edge. |
ambiguous_result_edge | Two succeeded edges without a when, or two failed edges, leave the same step. Keep one, or give one of the succeeded edges a when. |
result_guard_source | The when reads something other than fixed values and this step’s own answer. |
unknown_source_path | The tool’s output schema rules the path out: it closes a shape ("additionalProperties": false) without that field, it continues below a value that is text, a number or true/false, or it steps into a list with something that is not a position (/trips/first, /trips/-1, /trips/01; the message names the list and gives a position to try). A shape the schema leaves open is not checked, so a misspelt field in one is not caught here, and a comparison the call cannot make while it runs is false. |
result_guard_reader_unavailable | The voice engine this workspace’s calls run does not read a when on an edge yet, so nothing was published. |
when is also held to the condition rules of a sequence step
(condition_value_type, condition_type_mismatch and the others). Each code is
described on Check workflow.
A when on a result edge makes the document compiler_version 1.10.0. A
document without one compiles to exactly the bytes it did before, and a voice
engine older than 1.10.0 refuses a document with one at Check, naming each edge
(result_guard_reader_unavailable). A save keeps the draft either way. The
dashboard shows such an edge on the canvas and in the step panel and keeps its
when whatever else you edit on the step, but it does not author one: write it
through this API, an AI app connected to Yappr, or the Yappr skill.
Refusing a call before it starts
A before-call step can refuse the call itself. Route either outcome of the step to"#decline":
{ "id": "screen", "label": "Screen the number", "binding_id": "blocklist", "on_succeeded": "#decline" }
"#decline"is the only route target a before-call step may name. Pointing one at another step isbefore_route_target.- Refusing on failure needs
"on_failure": "continue"on the same step; otherwise the phase stops before the route could be taken (failure_route_conflict). - Only a before-call step routes at all. A route on a follow-up step is
route_phase, a"#decline"inside a sequence isdecline_phase— by the time a sequence runs the call is already connected — and awhencondition on a before-call or follow-up step isguard_phase, because a lifecycle step runs as soon as the steps it declares are done.
before.on_failure from them:
continue_with_available when any step continues on failure, otherwise
stop_admission. A document saved through this API keeps what it sends.
What the caller gets depends on the direction. An incoming call is never
answered: it is refused at the carrier, the same as a call arriving at an agent
that is switched off. An outgoing call is never dialled: no call record is
created, and GET /call-requests/{id} ends
at status: "failed" with preparation_status: "declined" and
error_code: "before_declined". A refusal is not a failure — nothing is retried,
and before.on_failure does not apply to it.
Which ways in the agent allows: channels
channels lists the ways a call can reach the agent: "phone" and "web".
Both are on unless you say otherwise, and a document must list at least one
(duplicate_channel refuses a repeated value). It is the same list the
dashboard’s Start sheet edits with its Phone and Browser switches.
| Value | Covers | What it needs |
|---|---|---|
"phone" | Incoming calls and the calls the agent places: POST /calls, a call request and a campaign. | An incoming call needs a number whose Inbound Agent is this agent, or an extension that points at it. An outgoing call names a from number of the workspace. |
"web" | Browser calls: the dashboard’s browser test, a shared link and a Web SDK page. | No phone number, and no setup beyond publishing. |
PATCH /phone-numbers/{id}. That write
is immediate and does not wait for a publish.
A channel left out of the published list is refused when a call on it is
prepared, before anything is dialled: the call request ends failed with
error_code: "artifact_unavailable" (Read a call request).
The dashboard’s browser test reads that code and says, in the person’s language:
“This agent isn’t ready to take browser calls. Publish it, and check that Browser
is on in its Start step.” (an unpublished agent ends the same way, so the sentence
names both). Keep both unless the agent must never be reached one way. Two more rules read
the list at publish time: a call transfer needs "phone" (tool_grant_channel,
transfer_placement), and every tool a step uses must be allowed on at least
one listed channel (unsupported_channel).
Before-call steps, the channel and the window
A document that declares before-call steps runs them on every channel it offers.channels may contain "web" alongside a non-empty before.steps: a browser
call is created, prepared and then started by the caller, exactly as an outgoing
call is created, prepared and then dialled. A browser client has to speak that
exchange — see Create Web Call Request.
How long there is to prepare belongs to the platform, not to the document —
there is no budget field to set:
- an incoming call prepares after it arrives and before it is answered, within 30 seconds;
- an outgoing call prepares before the dial, within five minutes;
- a browser call prepares after it is created and before the caller starts it, within the same five minutes.
depends_on,
charging each step the timeout of the tool revision it resolves to, and refuses a
chain that cannot fit either window: before_budget_exceeded against
/before/steps. Steps that do not depend on each other run together, so only the
longest of them counts. A chain that fits the outgoing window but not the
incoming one still publishes; on an incoming call it runs out of time, and what
happens then is before.on_failure.
before.on_failure says what a failure or a window that runs out means:
stop_admission, the default, refuses the call — so a chain too long for an
incoming call means that call is refused, not answered with partial results.
continue_with_available is the other choice: it answers or dials with whatever
the phase did produce.
Using a before-call result in step instructions
A before-call result can be written into what the agent says. The reference is checked when you publish and filled in when the call starts.{{before.step_id}} the whole result
{{before.step_id.field.subfield}} one field
{{before.step_id.field|text}} with text to use when there is no value
- Dots walk into the result, and a number addresses a position in a list:
{{before.availability.slots.0.time}}. - Everything after
|is used verbatim when the value is missing. A|with nothing after it is a declared empty string; no|at all means the reference simply disappears rather than leaving braces for the agent to read out. - Publishing resolves the step id against the before-call phase and the field
against the
output_schemaof the tool that step runs, so instructions can never reach data a tool input could not. - Only before-call steps can be read this way. A during-call or follow-up step has produced nothing at the moment the instructions are written.
- Write it exactly as shown — lowercase, no spaces inside the braces.
{{Before.…}},{{ before.… }}and{{before .…}}are refused rather than quietly left as text. - Two fields accept a reference:
global_instructions, and a conversation step’sinstructions. Anywhere else — a step’s label, a route condition, a tool’s or a sequence’s own description — is refused, because nothing fills those in and the agent would read the braces aloud. - A document that declares a call variable named
beforealongside a reference is refused; the name is reserved. - At most 256 references in one document. One reference is at most 512 characters and its fallback text at most 1,000.
- A quoted value is a phrase in a sentence, not a payload: one longer than 2,048 bytes counts as no value, so its fallback text is used (or, with none, the reference disappears). Quote a short field, not a whole long list.
- A result is read at most 8 levels down, and only the first 64 items of a list. A reference that goes deeper, or names a position of 64 or more, counts as no value and uses its fallback text, although Publish accepts it. A route condition reads the tool’s answer itself and is not limited this way.
before.on_failure is
continue_with_available, or the step itself continues on failure — a reference
with no fallback is an advisory rather than a refusal: Check returns it as the
warning code before_reference_missing_fallback, and publication is allowed. If
the value is missing when the call starts, the reference is removed and the agent
speaks the sentence without it — so add fallback text after the | when that
would read badly, or leave nothing after the | to declare the empty string on
purpose.
Check workflow lists every code these rules
raise and what to change for each.
Example: offer calendar times without a tool call
An agent that books appointments is quickest when the caller never waits for a calendar lookup after saying yes. Read the calendar’s busy times once, in a before-call step, and let the conversation offer times from that list. A booking call then makes one tool call in the middle of the call: the booking itself. The before-call step runs a connected-app tool for the calendar’sGOOGLECALENDAR_FIND_FREE_SLOTS action (Create Tool),
with a window written as relative times so it
moves with the day. time_max of in_days.14 is the same wall time 14 days from
the moment the step runs:
{
"before": {
"steps": [
{ "id": "free_time", "label": "Free time, next 14 days", "binding_id": "free_time", "on_failure": "continue" }
],
"on_failure": "continue_with_available"
},
"bindings": [
{
"id": "free_time",
"tool_revision_id": "TOOL_REVISION_ID",
"tool_revision_policy": "follow_current",
"inputs": {
"time_min": { "kind": "literal", "value": "{{call.time.now.Asia/Jerusalem}}" },
"time_max": { "kind": "literal", "value": "{{call.time.in_days.14.Asia/Jerusalem}}" }
}
}
]
}
end and busy and says how to use them.
Write it in the agent’s language and voice. The step’s id and label are also shown to
the agent, so name the window in the label, and write the same number of days in
time_max, in the label and after the | of the end reference (the text shown when the
step did not run):
Busy times from now until {{before.free_time.end|14 days from now}}: {{before.free_time.busy|unknown right now}}.
A time before that end that does not overlap any of them is free. Offer times from this
list and check a time against it; do not use Find free time for a time before that end.
Use Find free time only for a time after it, or when the list says unknown right now.
Book a time with Book an event once the caller has confirmed it.
n days on, so its last day is only partly
covered. That is why the text names the end the result carries, and never “these 14 days”:
a caller who asks for a later hour on the last day is asking about a time the list does
not cover.
What to know before you rely on it:
- It costs about a second, once. The step runs before the first word, so the caller waits for the lookup once at the start in place of every time the agent would have looked during the call.
- The list is as of the start of the call. A time someone else books while the call is on is not in it, and the calendar does not refuse an overlapping booking. A calendar that many people book at once may want a shorter window.
- Size the window to the calendar; do not rely on a fallback. The
busylist is a quoted value, so one over 2,048 bytes (about 35 busy events) reads asunknown right nowin the instructions. The data prepared for the agent still lists the events, up to 64 and cut off after that, and tells the agent it needs no fetching, so the two disagree and nothing makes the agent look at the calendar again. Keep the window under about 30 busy events:in_days.14for up to 2 busy events a day,in_days.7for up to 4,in_days.3for up to 10. For a calendar that is booked most of the day, leave this pattern out and keep Find free time in the conversation. - It needs relative times. A workspace whose calls do not run the newest voice engine
yet refuses the document when you publish it (
call_placeholder_time_unavailable, asking for a fixed date and time). Do not write a fixed window: it is wrong from tomorrow. Keep Find free time in the conversation instead. - Leave
strict_modeas it is: nothing here depends on step order.
Random variations in instructions
global_instructions and a conversation step’s instructions may vary from call to call:
{{Ask what they need|Find out what they need}} says one of its options, picked once when the
call starts. A step reads the same in the opening prompt and in its own step context, and a
reference keeps its fallback — {{before.step_id.field|text}} and {{call.field|text}} are
never read as a choice. The full rules are under
Random variations.
Integrations: an app on every step
integrations lists the connected accounts given to the whole agent, one entry per account, each with the actions it may use and the binding that runs each one. Manage them with /agents/{id}/integrations rather than by hand: that prepares each action, adds its binding and publishes. A save keeps them consistent whatever wrote the document: every integration binding is put on every conversation step that lacks it, and a binding of the integration shape (i_<account>_<action>) that no integration owns any more is taken off every step, and out of bindings when nothing else uses it. An integration binding cannot also run as an action step, a before-call or follow-up step, or inside a sequence (integration_binding_shared); Check and publish refuse a step missing an integration’s actions (integration_not_on_step) and more than 64 integration actions (integration_limit).
Action inputs: Fixed, from the call, AI, or a list
Every input of a binding has a source, and the same four choices cover every action - an app’s, a webhook’s or a transfer’s:| Choice | Source | What happens on the call |
|---|---|---|
| Fixed | {"kind":"literal","value":…} | Sent as is. The agent never sees the input. A value that is exactly one call reference, such as "{{call.caller_number}}", is that fact of the call. A relative time, "{{call.time.<when>.<zone>}}" (now, start_of_today, end_of_today, start_of_tomorrow, end_of_tomorrow, in_hours.<1-8760>, in_days.<1-366>; an IANA zone such as Asia/Jerusalem, UTC when left out), is worked out when the step runs and sent as RFC 3339 with that zone’s offset, for example "{{call.time.start_of_today.Asia/Jerusalem}}" → "2026-11-02T00:00:00+02:00". |
| From the call | request, stored, step (and artifact after the call) | Read from the call request, saved context or an earlier step. The agent never sees it. |
| AI | {"kind":"model","path":"/<input>"} | The agent fills it from the conversation. During the call only. |
| Choose from a list | {"kind":"model","path":"/<input>","options":[{"value":…,"label":…}]} | The agent picks one of 1-20 choices by its label; the tool receives the value. Text inputs, or a list of text, only. |
{
"id": "i_d3d44b7a_find_free_slots",
"tool_revision_id": "9f1c2b3a-4d5e-4f60-8a7b-1c2d3e4f5a6b",
"tool_revision_policy": "follow_current",
"inputs": {
"items": { "kind": "model", "path": "/items", "options": [
{ "value": "primary", "label": "Front desk" },
{ "value": "c_1a2b3c@group.calendar.google.com", "label": "Clinic" }
] },
"time_min": { "kind": "model", "path": "/time_min" },
"time_max": { "kind": "model", "path": "/time_max" }
}
}
primary). List an account’s calendars with GET /tool-connections/{id}/options/calendars. Check and publish refuse a required input with no source (missing_input_source, naming the action and the input), a list on an input that does not take text (options_type) and a value listed twice (options_duplicate).
Webhooks and transfers on every step
A saved webhook or call transfer can be given to every conversation step, like an app: anintegrations entry {"id": "tg_<tool>", "tool_id": "<tool uuid>", "binding_id": "t_<tool>"} whose binding runs that tool. Add it with POST /agents/{id}/integrations and tool_id. At most 8 such entries (tool_grant_limit); only an HTTP or transfer tool (tool_grant_kind), each once (tool_grant_duplicate); a transfer needs the phone channel (tool_grant_channel); its binding must exist and run that tool (tool_grant_binding_missing, tool_grant_mismatch) and cannot run anywhere else (integration_binding_shared). Ids of the shapes i_…, tg_…, t_<hex> and o_… are kept for these entries.
A step’s own settings for an agent-wide action
binding_overrides on a conversation step maps an agent-wide binding (an app action or a tool on every step) to a binding of the step’s own that runs the same tool with other inputs - for example a different calendar on one step:
{ "id": "booking", "type": "conversation", "binding_overrides": { "i_d3d44b7a_find_free_slots": "o_k3j9x0a2b1" } }
strict_mode on: with it off, both copies stay callable on every step and Check returns override_needs_strict. The key must be an agent-wide binding (override_not_grant) and the value must run the same tool (override_mismatch). When the agent-wide action goes, its overrides go with it.
Canvas positions
editor.positions keeps where the dashboard draws each node: a conversation step by its id, and before:<step id>, after:<trigger id>, after:<trigger id>/<step id>, grant:<integrations id>, #start, #answer and #decline. A key that names nothing in the document is refused (unknown_editor_node). Positions never change what a call does.
A line said while a step’s tool runs
An action step may carryhold_line: one short sentence the caller hears while that step’s tool
runs, so a slow lookup is not dead air.
{
"id": "check-diary",
"type": "action",
"label": "Check the diary",
"binding_id": "diary-lookup",
"hold_line": "רגע אחד בבקשה."
}
- It starts when the tool starts, never when the step is entered: a step that still needs details from the caller asks for them first, and the line plays as the tool is sent.
- It is said in the agent’s own voice, exactly as written, on both voice engines.
- The agent’s next words wait until the line has been heard, so a fast tool’s answer can come a little later than without it — never more than four seconds after the tool answered. A tool that takes longer than the line adds no wait at all.
- On GPT Live the agent says the line once it has finished its current sentence. If the tool answers before then, the line is skipped: the caller hears the answer instead.
- On Gemini Live,
"רגע אחד בבקשה."and"One moment please."play a recording made in every voice. Any other line is recorded in the agent’s voice when a call starts; on the very first call after you write it, a tool that runs in the first few seconds may run without it.
| Written in | Longest line |
|---|---|
| English and other alphabets (Latin, Cyrillic, Greek) | 28 characters, such as "Just a moment, let me check." |
| Hebrew or Arabic | about 25 characters, such as "רק רגע בבקשה, בודקת ביומן" |
| Korean, or Japanese in kana | about 16 characters |
| Chinese characters (and Japanese kanji) | about 10 characters |
hold_line that is not text of 1 to
28 characters (422 WORKFLOW_DOCUMENT_INVALID, field_invalid at
/conversation/nodes/<n>/hold_line, the step in node_id) and writes nothing; the dashboard and
the builder chat save under the same rule. Check
workflow refuses a shorter line that
still takes too long to say (hold_line_too_long), so every line that publishes fits in that
wait. null, or no hold_line at all, is no line of your own: the call then says
the default line when its tool is slow.
The line is fixed text. It cannot carry a {{...}} reference or a random variation, and a
transfer step cannot have one — it says the announcement set on its transfer tool. A document
with a hold line compiles for runtimes that know the field (compiler_version 1.5.0); a
document without one compiles as before and still gets the default line, which needs nothing in
the document. A flow agent’s
Play hold tone (pre_fire_announcement) becomes this
line when the agent moves to a workflow, in the agent’s language: the clip’s own words,
"רגע אחד בבקשה." or "One moment please.", both inside the limit. A line is never cut short to
fit; one that did not fit would be left off the step, and the move would say so.
Check workflow names
hold_line_blank, hold_line_not_fixed, hold_line_too_long and hold_line_on_transfer.
The default line
A slow tool with nohold_line is not met with silence either. When the agent is about to run
one, the call says a short fixed line itself as the tool starts: "One moment please." or
"רגע אחד בבקשה.", the shipped phrase of the call’s language. It covers the tools a
conversation step offers (including the ones given to the whole agent) and an action step with
no hold_line.
- It is said only for a tool that really runs: not when the agent answers in words, not for End call or a transfer, and not when the call is refused before the tool is sent.
- It is said only for a tool that usually takes about two seconds or longer. The call learns this from that tool’s recent runs on the same server; until it has a few, a connected app such as Google Calendar counts as slow and a tool you call by URL counts as fast. A tool that usually answers faster gets no line.
- English and Hebrew only. Another language, or an agent set to answer in several languages, gets no default line.
- It starts only while the tool is still running; a line the call has not started by the time the tool answers is dropped. The answer does not wait for it: never on GPT Live, and on Gemini Live for at most half a second, so the line is not cut off.
- On Gemini Live it is skipped when the agent is already talking. On GPT Live it is skipped when the agent has just said its own “one moment” or “let me check”, and it waits for the agent to finish its current sentence first.
- On GPT Live, a tool that usually takes over six seconds (booking a calendar event) gets one
more short line (
"Still working on it."or"עוד רגע בבקשה.", then"Thanks for your patience."or"תודה על הסבלנות."on the next such tool) about four and a half seconds after the first, only while the tool is still running.
hold_line you write on an action step replaces the default for that step. There is no field
to turn the default off, or to change its words, for a tool a conversation step offers.
Branching inside a sequence
A sequence step may carry a condition and route its own outcome. Conditions are declarative data: Yappr never evaluates a customer expression and never runs customer code. A condition is one comparison —{"kind":"compare","source":{…},"op":"…","value":{…}} — or a combination of
comparisons: {"kind":"all_of","conditions":[…]},
{"kind":"any_of","conditions":[…]} or {"kind":"not","condition":{…}}.
all_of and any_of take 1–16 conditions each. A condition nests at most four
levels — at most three all_of/any_of/not wrappers around a comparison —
and declares at most 32 parts in total.
Both source and value are ordinary input sources, limited to the kinds that
read data already frozen when the step is decided: literal, request,
stored, sequence and step. Live model arguments and produced call
artifacts are not readable in a condition.
Operators
exists, not_exists, eq, neq, gt, gte, lt, lte, contains,
not_contains, in, not_in, is_true, is_false, is_empty,
is_not_empty.
exists, not_exists, is_true, is_false, is_empty and is_not_empty
take no value. Every other operator requires one.
- Nothing is coerced.
"1"never equals1;1and1.0are the same number. gt,gte,ltandlteapply to numbers only — a boolean is not a number.inandnot_inneed a list on thevalueside.containsis text inside text, or a list holding that exact value.is_emptyandis_not_emptyapply to text, lists and objects. A JSONnullis none of those, so both answer false for it. Test for it witheqagainst{"kind":"literal","value":null}.existsasks whether the path resolved. A source that declares afallbackalways resolves, so it always exists.
Routes
on_succeeded and on_failed name another step in the same sequence, or
"#end" to finish the sequence early.
on_failedrequires"on_failure": "continue"on the same step; a stop is never overridden implicitly.- Nothing may route back to the sequence’s first step — that step is the one the sequence starts with.
- Declared dependencies and routes together must be acyclic.
- Steps with no route keep running in dependency order, so a sequence that declares no condition and no route behaves exactly as it did before.
- A sequence that branches runs endpoint-calling and connected-app steps only. Keep a transfer outside it.
Skipped steps
A step whose condition is false is skipped: it is never dispatched, makes no attempt and holds no result. So is a step that depends on a skipped one, and a step that only a route could have started when no route reached it. Routing to"#end" finishes the sequence and skips everything still outstanding. The run
carries on without the skipped step.
A skipped step produces nothing, so read one of its outputs only through a
source that declares a fallback, and map a required sequence output from such
a step only with a fallback — otherwise leave that output field optional.
Check workflow lists the issue codes these
rules raise and what to change for each.Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).
Headers
Body
Response
Saved draft with its new version. Re-sending the identical save after a lost answer returns this same 200 rather than a conflict: the draft already is the document that was asked for.