Skip to main content
PUT
Save canonical workflow draft
Requires agents:update. Saving never publishes or executes an action.
string
required
Local agent UUID.
integer | null
required
The exact draft version returned by Read workflow. Null is valid only if no draft exists; New Agent already creates the initial version.
object
required
The complete canonical workflow document. Send its 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}.
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 carries issues[] 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. A refusal about a binding also names the step that runs it — 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 the label every step carries, and an After trigger’s event from the event list, and an action step’s hold_line of 1 to 28 characters — plus a change to the server-owned id or name, 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 a stored source reading a path stored_schema does not declare. Every problem is named in the one answer, by path, error is 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.
The most common reference mistake is a tool’s own id in 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.
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:
Publish the same version when it is valid. Nothing reaches a live call before that. Publish answers with the revision it created, and that revision carries an 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:
Only the conversation can ask the model for a value, so a follow-up reads one that was already put somewhere: 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:

Sending what the agent extracted

The values the agent was asked to pick out of the conversation are the analysis artifact’s extracted_data, so a follow-up hands them to a tool with an ordinary artifact source — one field, or the whole set:
Each field sits at /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:
The step waits for the call’s analysis on its own (no 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 on call.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_end is every way a call can stop — it covers call.ended, call.failed and call.no_answer. Use it for a follow-up that must run whatever the ending, and leave its steps’ requires empty: it includes the call nobody answered, which never has a transcript, analysis, recording, lead or billing. Check warns with after_any_end_waits when a step on it waits for any of them.
  • request.failed is 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.answered is 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 of any_end — a trigger on however the call ends never fires on a pickup, and one on call.answered never fires on an ending.
A follow-up on 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:
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: The three endings never happen on the same call, so those follow-ups are alternatives: for one call, exactly one runs. Two things to know:
  • Every follow-up whose event matches, and whose “Only if” holds, runs. any_end plus call.no_answer on one agent both run when nobody answers, so a team gets two messages. Use any_end alone, 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 on analysis.ready with an “Only if” on the disposition. The disposition is guaranteed on analysis.ready only; on the ending events it is written a moment after them.
To reach a step that needs the transcript or analysis on a call that may not have one, do not wait on 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 optional when: 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:

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 with trigger_filter_unavailable, naming the field, the event and where to move it. The disposition and the collected fields are written in the same moment as 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 whose when 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:
One limit to know: a filter on 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 (an action 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:
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. when is a compare, all_of, any_of or not, 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 path may step into a list by position: /data/trips/0/distance is the distance of the first trip. A position is a whole number written without a leading zero (0, 1, 12; not first, -1 or 01). A list the tool marks optional ("type": ["array", "null"], how connected-app tools declare most lists) is read the same way. If the list is null, 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/0 reads the first trip; there is no “any item” or “last item”.
  • In the order written. The edges with a when are tried in the order they appear in conversation.edges, and the first that holds is taken. Put the most specific one first.
  • Exactly one otherwise edge. A step with any when needs one succeeded edge without one. Two without are still ambiguous, and so are two failed edges.
  • Success only, and Strict only. A failed edge never has a when: it is taken whenever the tool fails, whatever it answered. A when needs strict_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 failed edge, with or without a when on the step, and the request is not sent again. A step with no failed edge 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 its failed edge like any other step.
  • A step without a when is routed by succeeded or failed exactly as before.
Nothing is coerced: "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:
Each ordering comparison has its positive opposite (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: A 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":
  • "#decline" is the only route target a before-call step may name. Pointing one at another step is before_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 is decline_phase — by the time a sequence runs the call is already connected — and a when condition on a before-call or follow-up step is guard_phase, because a lifecycle step runs as soon as the steps it declares are done.
The dashboard offers each before-call step one failure choice — stop the remaining steps (the default), continue with the results that are ready, or refuse the call — and writes 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. There is no separate switch for incoming and outgoing calls: the numbers decide the direction. To have the agent answer a number, or place calls from it by default, bind it to the number with 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.
Publication follows the longest chain of before-call steps through 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.
  • 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_schema of 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’s instructions. 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 before alongside 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.
Where the producing step may legitimately not run — 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’s GOOGLECALENDAR_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:
The conversation step quotes the result’s 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):
The window ends at the same time of day, 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 busy list is a quoted value, so one over 2,048 bytes (about 35 busy events) reads as unknown right now in 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.14 for up to 2 busy events a day, in_days.7 for up to 4, in_days.3 for 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_mode as 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:
If the agent sends a value for an input you settled another way, it is ignored; any other argument it was not asked for is still refused. A Google Calendar action’s calendar that has no source is the main calendar (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: an integrations 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:
On that step the override runs instead of the agent-wide binding - reliably only with 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 carry hold_line: one short sentence the caller hears while that step’s tool runs, so a slow lookup is not dead air.
  • 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.
The line has to finish inside that four-second wait, so it is short: about 2.5 seconds of speech. Every character counts, spaces and punctuation included, and a digit counts as about three characters because it is said as a word. A save refuses a 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 no hold_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.
A 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 equals 1; 1 and 1.0 are the same number.
  • gt, gte, lt and lte apply to numbers only — a boolean is not a number.
  • in and not_in need a list on the value side.
  • contains is text inside text, or a list holding that exact value.
  • is_empty and is_not_empty apply to text, lists and objects. A JSON null is none of those, so both answer false for it. Test for it with eq against {"kind":"literal","value":null}.
  • exists asks whether the path resolved. A source that declares a fallback always resolves, so it always exists.
Types are checked when you publish, against each source’s declared schema wherever that schema commits to a type. A source whose schema declares none is checked again while the call runs, where a value of the wrong type makes that one comparison false rather than failing the call.

Routes

on_succeeded and on_failed name another step in the same sequence, or "#end" to finish the sequence early.
  • on_failed requires "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

Authorization
string
header
required

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

x-company-id
string<uuid>

Explicit active workspace. Optional; when sent it must be the API key's own workspace — any other value is refused with 403 WORKSPACE_MISMATCH.

Path Parameters

id
string<uuid>
required

Body

application/json
expected_version
integer | null
required

Exact saved draft version. Null is accepted only when no draft exists; New Agent already creates version1.

Required range: 1 <= x <= 9007199254740991
document
WorkflowDefinition · object
required

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.

agent_id
string<uuid>
required
execution_version
enum<string>
required
read-only
Available options:
legacy,
workflow_v1
draft
null | object
required
published
null | object
required