Skip to main content

The submit

The submit: what execution does​

The submit of a skill with kinds is a list of named calls, run in order. A kind can have its own, in kinds.<kind>.submit. So can a playbook, for the order that sends the lines of several of its tasks (below).

    submit:
- name: dispatch
mode: request # request (default) | handover | self
tool: createDelivery
args:
body.address: "$item.fields.address"
body.items: "$selection[kind=dish]"
body.fee: "$item.price"
body.idempotency_key: "$action.key"
line: {slug: "$line.ref", quantity: "$line.quantity"}
keymeaning
namethe call's name: letters, digits, _, -. Unique among a skill's calls (its own and its kinds'). Required
moderequest by default; see the table below
toolthe operation called. Required for a request: without it, the station is refused
urlthe tenant's link, for a handover
argsthe operation's inputs (body.x, query.y) and their sources
outputwhat the call keeps of the tenant's answer, for a later call: {<name>: {from: "$output.<path>", type: <type>}} — see below; with role: billed, the tenant's total, compared with the lines sent (below)
linethe shape of a line sent to the tenant, for a request — see below
extra_lineslines sent without being chosen (the cutlery), for a request — see below
modemeaningwhat is sent
requestConvoy calls an operation of the tenanttool with args
handoverthe person finishes on the tenant's sitenothing; they receive the declared url link
selfthe person takes care of it themselves (pickup at the counter)nothing; it is recorded

A self line, or a handover line once its link is given, is marked filed by the submit, like a filed request line: a later submit counts it as already filed — it neither files it twice nor holds it to its quantity rule any more.

Several calls, in order. A skill or a kind can declare several calls: they run in the order written, except where a $submitted[…] reference orders one after another (Execution). Several calls are all requests: a handover or a self is on its own all that becomes of the line, and it is written alone.

  • Each line keeps the calls that filed it. It is filed once every call that sends it has filed it. A retry sends only the calls still owed: the one that succeeded is never sent again.
  • A partly filed line no longer changes. While one of its calls has succeeded and another is still owed, it cannot be removed, added again or given another quantity, and the selection cannot be cleared: the rest would receive something other than what the first call received. The sentence says so, and asks to submit again to send the rest.
  • A submit in which a call succeeded is partial if a line is not filed in full, even when none is: it is recorded in the room, and the retry reads it. A line owing an argument only it can give (a field of its form left empty) makes no partial: the lock holds the whole submit before the first call, the complete calls too, as for a line field owed (see below).

The sources of args.

writegives
$selectionthis call's lines (its skill's, or its kind's), one per item, in the shape of line. Refused on a playbook's call
$selection[kind=X]the lines of kind X, across the whole selection (within the playbook's tasks, for a playbook's call), in the shape of line — filed only if this call succeeds; otherwise they stay in the selection
$selection[task=a,b]on a playbook's call only: the lines of those tasks, in the shape of line
$item.fields.<field>a filled-in field of the item
$item.pricethe amount computed by the update: {price: …} guard
$item.refthe item's reference at the tenant
$submitted[<task>.<call>].<output>an output of another call in the same submit — see below
$submitted[<call>].<output>on a playbook's call: an output of another call of that playbook, cited by its name alone
$params.<name>a parameter of the skill: the value the model gave at the call that showed the line, the binding a task of the active playbook gives it, else its default — see below. Refused on a playbook's call
$action.keythe idempotency key of the action this call files
$submit.<field>what the person answered in the form of the submit guard the call runs under (the active playbook's when it declares one, else the station's), or what the room already knew for an identifies field (Auth)

$item… is not read on a playbook's call: it sends several lines, there is no one item. What comes from a line goes through line:, what comes from the person through $submit.<field>.

An order is declared on the playbook​

A call lives where what it files lives:

  • A call that files one action of a skill — a delivery, a pickup, a refund — lives on the skill or on its kind.
  • A call that sends the lines of several tasks in one request — an order: the dishes and the drink, in one placeOrder — is declared once, on the playbook, in submit, next to its own submit_guard.
playbooks:
- name: take-meal-order
tasks:
plats: {skill: takeMealSelection, label: "Vos plats"}
boisson: {skill: takeDrinkSelection, label: "Votre boisson", after: [plats], required: false}
submit:
- name: order
tool: placeOrder
args:
body.items: "$selection[task=plats,boisson]"
body.customer.phone: "$submit.phone"
body.idempotency_key: "$action.key"
line: {slug: "$line.ref", quantity: "$line.quantity"}
submit_guard:
form:
phone: {type: phone, required: true, label: "Téléphone"}
confirm: true
  • A playbook's call is a request that sends lines of its tasks: $selection[task=plats,boisson], or $selection[kind=k] for a kind of its tasks. A bare $selection is refused: it would send whatever lines the room holds. A call that sends no line belongs to the skill whose action it files.
  • A line leaves by one call only. Inside the playbook, a line one of its calls takes leaves by that call only: its skill's calls do not run for it. Two calls of the playbook taking the same kind are refused at load. A playbook's call does not take a kind whose own call is a handover or a self: a line is sent or it is not, never both (refused at load).
  • Outside the playbook, a skill keeps its own calls. A line whose skill has no call of its own, chosen outside the journey that sends it, is held, never sent: "… cannot be sent from here: open the flow that sends it, then submit again" (submit.held_no_call, which texts can rewrite).
  • Every kind leaves by a call. A kind whose lines leave by no call — neither its skill's or its own, nor a call that takes it through $selection[kind=…], nor a playbook's — refuses the station: chosen, its lines could never be sent. A skill that only answers is not concerned.
  • It is cited by its name alone: $submitted[order].order_id. Its names are unique in the playbook, and differ from its tasks'. A task whose params read $submitted[order] waits for the required tasks whose lines order takes; an optional task is not waited for (the order leaves without it). Reading the call that takes the task's own lines is refused: it would wait for itself.
  • The playbook's submit_guard has the same keys as the station's (form, confirm, validate, submitted_by). Inside the playbook, its own applies; without it, the station's. A $submit.<field> of a playbook's call, or of a call of the skill of one of its tasks, must be in the form of that guard. For submitted_by, the stricter rule of the two wins (Policies).
  • The price leaves with the line. A kind whose price comes from an update: {price: …} guard and whose lines leave by a playbook's call must have $line.price in that call's line:: otherwise the customer would see an amount the tenant never receives, and the station is refused.

Reading another call: $submitted and output​

skills:
- name: formation
invoke: {method: recommendLegalStructure}
kinds: {company_formation: {}}
submit:
- name: open
tool: openFormationDossier
args: {body.idempotency_key: "$action.key"}
output: {company_id: {from: "$output.company_id", type: id}}
- name: accounting
invoke: {method: getAccountingPlans}
kinds: {accounting_subscription: {}}
submit:
- name: subscribe
tool: subscribeAccounting
args: {body.company_id: "$submitted[societe.open].company_id"}

playbooks:
- name: open-company
tasks:
societe: {skill: formation}
compta: {skill: accounting, required: false, after: [societe]}
  • The task is a playbook's: $submitted[societe.open] cites the call open of the skill formation, whose task is societe. Written on a skill's call, the reference holds for the whole station (a skill belongs to no playbook): two playbooks may share a task name if it designates the same call; a name two playbooks give to two different calls is refused when read. It does not place the task it reads first: write the after.
  • A choice is one reference. Two methods of one one_of may each have a call of the same name (pay for the refund and for the credit note): $submitted[geste.pay] reads the method that was filed.
  • Only what output declares can be read. Each output says where it is read in the answer (from: $output, the whole answer, or $output.<path>, a path into the answer) and its type, required, taken from the type table. The rest of the answer is kept for no one.
  • Only a request has an answer. output on a handover or self call refuses the station, as does a reference to such a call.
  • A playbook's call is cited by its name alone: $submitted[order].order_id, in the args of another call of the playbook or in the params of one of its tasks (An order is declared on the playbook).
  • Checked at load. Citing a call no task runs (a skill's name where a task's is meant, a skill that is the task of no playbook), an undeclared call, an undeclared output, the call's own answer, or any form other than $submitted[<task>.<call>].<output> or $submitted[<call>].<output> refuses the station. An output nothing reads gives a note. A task's binding (params) to an output of another type than its parameter is refused too: a value is never converted.
  • At execution, the call that reads another runs after it. If the cited call failed, if the reference cannot be answered, or if two methods of one choice answer it, the dependent call is put on hold (receipt held, with waits_for): it is never filed with a blank value. The same when the answer the reference reads is not of the output's type (an object for an id, an absent value, a boolean): the call is held, never sent, with the sentence submit.held_wrong_type ("… was not sent: what … answered is not what it needs — the merchant has to look into it"). The log names the call, the output and its type, never the value. The same for a line whose stored call reads a source Core does not know: it is put on hold, never sent with that source as its own text; it has to be chosen again.
  • If the cited task has nothing in the selection, the reference is empty, and the key leaves with no value. If the operation requires that argument, or requires it or another one (the SIREN or the company_id of a company just opened), the call is held when none is given: see What the operation requires.
  • A retry reads what its attempt already filed. Every submit belongs to an attempt, and its record in the room carries that attempt and its outcome. Inside a journey, the attempt is the open journey. Outside one, it is the last submit's when that one was partial, outside a journey too, and a line it did not send is still in the selection (corrected in place, it is the same line; removed and chosen again, it is a new one); otherwise it is a new attempt — another order chosen later is never linked to what an old partial submit opened. After a partial submit (the company opened, the accounting refused), the accounting is therefore linked to the company the first submit opened. What an earlier journey filed is never read. No date is compared. If that record cannot be read, the call depending on it is held ("… cannot be read right now — try again in a moment"), never sent blank; if the journey itself cannot be read, the submit is refused.

The tenant's total: role: billed​

An output with role: billed is the tenant's total for what the call filed — a kitchen's items_total. After the call, Core compares it with the lines the call sent.

    submit:
- name: order
tool: placeOrder
args:
body.items: "$selection[task=plats,boisson]"
body.idempotency_key: "$action.key"
line: {product_id: "$line.ref", quantity: "$line.quantity", variant_id: "$line.fields.variante"}
output: {total: {from: "$output.items_total", type: price, role: billed}}
  • Convoy's total is, for each line sent, the quantity times its billed unit price, options included (line fields). A line added by extra_lines counts 0.
  • A difference, or an answer with no total of type price, is never a success. The submit ends in total_mismatch, not ok: the order is not confirmed, and the sentence gives both totals (submit.total_mismatch: "… was filed by the merchant at …, not at the … shown — it is not confirmed at the total you saw…"; submit.total_unread when the answer does not say its total). It is never announced as placed at a total other than the one shown, nor as not filed.
  • The tenant's reference is kept: the call's receipt (status: total_mismatch) and what the room keeps of the order carry the tenant's answer, so it can be quoted. The lines stay in the selection; a retry sends the same $action.key again. The log records it as an error, with both totals and without the fields' values.
  • Checked at load: the output is a price, one per call at most, and only on a call that sends lines ($selection… in its args). Otherwise the station is refused.
  • The call sends the action's key ($action.key), otherwise the station is refused at load: without it, the retry after a difference would be a second order.
  • Without a role: billed output, nothing is compared.

$params at submit​

A submit call reads a parameter of its skill with $params.<name> in its args. Its value is the binding a task of the active playbook gives it, for the line's method (A task's params), else the parameter's default. For a parameter the model sets (set_by: [llm]), it is the value the skill's call used to show the line (set_by): it is kept with the line, never asked again.

  • A value the model gave is sent as it is. It is never read as a reference: a text "$context.api_key" given as a question stays that text.

  • A binding leaves with the answer of the call it reads, in the same submit, after it.

  • A binding has no fallback. If nothing in this submit or earlier in this journey answered it (the gesture's line left the selection), or if the call it reads failed, the call is put on hold.

  • Neither a binding nor a default: the call is put on hold, with the reason — "… reads $params.refund_id, which nothing sets here — no task of the active playbook binds it, and it has no default". That is the case of a skill run outside the playbook that binds its parameter.

Idempotency: $action.key, never $item.id

$item.id is the item's reference, the same for every customer who chooses this item. A tenant that deduplicates on it gives the second customer the first customer's order, with ok: true. $action.key comes from the room, the call and the lines it files; it stays stable for a retry. Two calls get two keys, even over the same lines. Several lines filed by one call (three dishes ordered together) are one action and share one key.

handover — the URL is the tenant's, with a closed set of placeholders: {tenant_url}, {items}, {room}. An unknown placeholder makes the station refuse to start.

The conditions to meet before executing — the submit guard — are in Policies.

What the operation requires​

Core reads from each operation's input schema, as the tenant's API declares it, what it requires:

  • required properties, at any depth the args reach: body, body.customer.phone, and each element of a list (body.items[].qty).
  • An anyOf whose branches are only required lists: one or the other (anyOf: [{required: [siren]}, {required: [company_id]}]).

Types, enum, oneOf and allOf are not read. An argument is missing when it is absent, null, or blank text.

At load, the station is refused when:

  • a requirement that holds for every call (reached through required objects, and each element of a required list) is filled by no key of args — nor, for the elements of a list, by any key of line:: line: "$line.ref" sends identifiers, with no keys. The same for a required anyOf none of whose branches is sent;
  • a plain required argument is read from a form field ($item.fields.<field> or $submit.<field>) that every form asking it lets the person leave blank (required: false).

What depends on the selection — a $submitted[…] a task left empty, a parameter with no value, which branch of an anyOf is given — is checked at submit.

Before the submit, the lock says it already, by the same rule: what depends on the lines only — a form field left empty that only the call requires, with nothing else to give it — holds the whole submit — no call leaves, not even the complete ones — and the person and the agent read lock.missing ("… cannot be sent: it needs …, and nothing gives it — complete it before finalising"); the playbook's envelope never says "ready to submit" over it. What an earlier call of the same submit will give ($submitted[…]: the company the formation opens) is said as a condition (lock.on_condition: "… is sent only once … has given what it needs"): the person can finalise, and the agent does not present it as settled. What the submit guard's form asks ($submit.<field>) counts as given: the submit asks it.

At submit, only what the lock cannot see is left: a field of the submit's form left empty ($submit.<field>), or an earlier call that answered without the value a $submitted[…] reads. Such a call is held, never sent, and the others leave. Its receipt says status: held, held_for: missing_args, and missing: for each requirement, its branches, as paths ([["body.siren", "body.company_id"]]: one or the other; the paths of one branch are joined by and). The log names the call, the operation and the paths, never the values. The line stays in the selection, and a call that reads the held call through $submitted is held too. When no call left, the submit does not say the tenant's service failed: the tenant received nothing.

The person reads submit.held_missing: "… was not sent: it needs …, and nothing gives it — complete it, then submit again". Each missing thing is named as they know it: a form field of the line by its label, a $submit.<field> by the label in the submit's form, a $submitted[<task>.<call>] by the label of that task in a playbook. The branches of an anyOf are joined by "or". When the person cannot give it (a parameter, $context, a literal, nothing mapped), the sentence is submit.held_config ("… this station's configuration does not say everything it needs"). Both can be rewritten in texts.

An operation without a schema is open: nothing is checked. When the station's APIs cannot be listed at load, nothing is checked either, and the log says so.

Execution​

  • One request per call, never per operation: two calls of the same operation (on two skills, or on a skill and a kind) leave as two requests, each with its own args and line. An order that must leave in one request is declared on the playbook.
  • In order: a call that reads $submitted[…] runs after the one it reads. Otherwise, the operations declared reversible: false (Sources) run after every other; then the tasks' calls in the order of the tasks, then the playbook's in the order it writes them.
  • A write that reads the result of a write that failed or was held is held, never run on an empty value. Lines of one call bound by $params to different values are held: neither value is the call's.
  • Only filed lines leave the selection. The rest stays there, for a retry.
  • A partly filed line is frozen until the next submit: not removed, not re-quantified, not replaced, not cleared with the selection — and a dependency (on_loss, on_change) neither removes nor revalidates it. The rest is owed to it as it was. What it depends on cannot be removed while the rest is owed to it, whatever flow is open: the person is refused the removal, and an on_change: clear that would remove it (it, or what its removal takes with it) does not happen — the submit then holds it as a clear that did not happen, until it is chosen again. on_change: block and revalidate still apply to it. An upstream that left the selection because it was filed does not hold it.
  • Partial failure: what is filed stays filed. Nothing undoes it. Undoing through the operation a write declares in reversible is not built: it will be an explicit action, never an effect of the failure (Current limits).

line: — the shape of a line​

line: says what one line looks like to the tenant, in its own names. It is declared on the request call of a skill, a kind or a playbook that sends the lines ($selection, $selection[kind=X], $selection[task=a,b]).

formsends
line: {product_id: "$line.ref", quantity: "$line.quantity"}one object per line, with the tenant's keys
line: "$line.ref"the bare reference, for a tenant that expects a list of identifiers (timesheet_ids: [..])
nothing{slug: "$line.ref", qty: "$line.quantity"}, Convoy's shape

The sources of a key: $line.ref (the item's reference at the tenant), $line.quantity, $line.price (the billed unit price of the line, options included, not the line total), $line.fields.<field> (a presented field of the line, or a line field: the value kept, the id of the option chosen). The one-value form accepts only "$line.ref".

  • A key whose source a line lacks is left out, never sent empty: an optional field left unanswered (empty or missing), a line field this line's kind does not have (the drink of an order whose dishes have a side dish). 0 is a value, and it is sent.
  • Check line: against the tenant's schema. A key it does not know, its API ignores and applies its own default, with no error: without line:, a tenant that expects quantity receives qty and orders 1 for a customer who wanted 2.
  • Checked at load:
    • an unknown source, line: {}, or a string other than "$line.ref" refuse the station;
    • so does a line on a handover or self call: those calls send no lines;
    • a $line.fields.<field> must be declared in the present.fields of the skill of the lines the call sends, or as a line field of one of their kinds (kinds.<k>.fields) ($selection: the call's own kinds; $selection[kind=X]: X's skill; $selection[task=a,b]: those tasks' skills). Otherwise the station is refused: the key would be left out of every line;
    • line: "$line.ref" is refused if a kind of the lines it sends has quantities (its rule's max is not 1): write select: {quantity: {max: 1}} (a set, each item once, select.quantity), or send an object with the quantity;
    • a line on a call whose args send no $selection gives a note: it shapes no line.

extra_lines — lines sent without being chosen​

Some lines leave with the order without anyone choosing them: the cutlery, when the restaurant keeps it as two 0 F products. The person says how many in the submit form, and the order carries one of the two lines.

    submit:
- name: order
tool: placeOrder
args:
body.items: "$selection[task=plats,boisson]"
body.idempotency_key: "$action.key"
line: {slug: "$line.ref", quantity: "$line.quantity"}
extra_lines:
- {ref: couverts-avec, check: getMenu, quantity: "$submit.couverts", when: "$submit.couverts > 0"}
- {ref: couverts-sans, check: getMenu, when: "$submit.couverts == 0"}
submit_guard:
form:
couverts: {type: quantity, required: true, label: "Combien de couverts ?"}
keymeaning
refthe line's reference at the tenant. Required
checkthe station's read operation whose answer contains the ref. Required
quantitya whole number above zero, or $submit.<field>. 1 without it
whena condition reading $submit.<field>. Without it, the line always leaves

Where they are written.

  • On a request call: a skill's, a kind's or a playbook's.
  • The added lines join the call's lines. It must take them from one $selection… source: with none, or several, the station is refused.
  • They have the shape of its line:. An added line has only ref and quantity: the keys that read $line.price or $line.fields are left out of it.
  • line: "$line.ref" is refused if an added line has a quantity other than 1: it would be lost.

What they read.

  • quantity and when read $submit.<field> only. It is a field of the form the call runs under: the playbook's submit_guard if it declares one, else the station's. The call of a task's skill reads its playbook's guard. A field that form does not ask refuses the station.
  • when is written in the condition language (Policies).
  • A field read as a quantity must be type: quantity, or the station is refused. A quantity field refuses a negative answer (form.negative): no when then lets an order leave without the line it expects.

At submit.

  • A when that is neither true nor false (an optional field left unanswered) holds the call, with the sentence that names that field (submit.held_extra_unanswered): neither sending the line nor dropping it is what the person said.
  • A quantity that is not a whole number above zero holds the call, with the sentence that says so (submit.held_extra_quantity). Never a line at 0.
  • Before any call, Core reads once the check of each line that leaves, with no arguments. Its answer must contain the ref as a value, anywhere in the JSON. A numeric id matches its text. Otherwise the call is held (submit.held_extra_missing): it never leaves without its line. A call that reads a held call waits too.
  • $action.key counts the added lines: three cutlery and none are two orders.
  • The call's receipt repeats the added lines, their ref and their quantity.

The proof at the tenant. No skill showed these lines. The tenant's answer is the proof, never a skill, whose kinds.when and require say what to show, not what exists.

  • check names a declared operation of the station, access: read. Otherwise the station is refused at load.
  • The provisioner asks the same question at every provisioning. An absent ref refuses the station, and nothing is written (Check and publish).
  • It asks it again at every observation of a running station. A ref gone: the station is no longer ready (degraded), and its orders are held.

What it looks like​

Terre & Table. Signed in, the customer has ticked the confirmation: the confirmation says what goes out — 2 items, €9.80, products and delivery included. She submits, not the agent.

submit_guard:
confirm: true
submitted_by: [{who: owner}]

Terre & Table. The submit called placeOrder on the grocery's API, which answered: the receipt says "Commande passée" (order placed) and gives the reference the grocery returns.

    submit:
- name: placeOrder
mode: request
tool: placeOrder
args:
body.items: "$selection[kind=product]"
body.window: "$item.ref"
body.delivery_fee: "$item.price"
body.customer.email: "$item.fields.customer_email"
body.idempotency_key: "$action.key"