Skip to main content

Module calls

Module calls 

Expand description

The call protocol every tool speaks: a method name and JSON arguments, answered with a JSON value or an error. Server mode relays these calls to the worker that holds a run’s shard; the HTTP API turns its routes into them; an SDK’s engine answers them on its own thread through a Relay.

MethodArgumentsAnswer
starttype, id, input, version, options: {timeout, idPolicy}null
updateWithStartthe same, and name, arg, updateIdthe update’s result
signalid, name, valuenull
queryid, name, argthe answer
updateid, name, arg, updateIdthe result
resultidthe result
cancel, terminateid, reasonnull
editStateid (<type>/<key>), edit (see crate::object::edit), updateId{version, changed}
resumeidnull (refused if nothing is paused)
resetid, beforeStep, reapplySignals, versionnull
completetoken, valuenull
failtoken, error (a failure envelope or text)null
listwhere, limitrun summaries
describeida summary with journal (and, for a key of an object type, objectDetail)
streamReadid, run, name, from, waitMsa stream batch
typesregistered workflow types and their versions
metrics{ total, shards } counters
infowhat serves the calls

An error answers {"error": message, "kind": snake_case code, "code": Code}; one that carries a failure sends its envelope as error.

Structs§

Namespaced
Calls limited to one namespace, a prefix of the workflow ID: what a namespace’s token reaches. Calls on a run need its ID under <namespace>/, a completion token must be for such a run, lists show only those runs, and of the calls on the engine as a whole only info, types and limits answer (schedules and objects, whose IDs start with their own prefixes, need the full token).
Relay
Calls for an engine that lives on another thread (an SDK’s): the HTTP thread queues each call and wakes the engine’s thread, which takes them with next and answers with reply.
RelayedCall
One call waiting for an SDK’s engine to answer it.
Stamped
Calls that name their requester: the HTTP API’s token or proxy identity goes into the arguments of the AUDITED calls as by (replacing any the request gave), so it reaches the engine that runs them, across a server too.

Constants§

AUDITED
The calls that change a run, whose records name who asked (audit).
MAX_STREAM_WAIT_MS
The longest a relayed stream read waits.
OUTSIDE_NAMESPACE
How a refusal for a namespace’s token begins (answered with 403).
RELAY_BASE
Relay IDs start here, above a server connection’s, so one host can answer both.

Traits§

Calls
Something that answers protocol calls: an engine, a relay to an SDK’s engine, a server.

Functions§

answer
A result as a call answers it: {"value": ...} or the error.
base64
Standard base64 (for files inside JSON answers).
decode_answer
An answer, as a value or the error it carried.
decode_error
The error an answer carried.
edit_state_call
An editState call as the call it is: updateWithStart of the key’s edit handler (starting the key’s run if it has none), with who asked in the edit, which its Update record keeps.
error_json
An error as a call answers it.
error_kind
The error’s kind as calls carry it.
is_traceparent
A W3C traceparent (00-<32 hex>-<16 hex>-<2 hex>); anything else is not recorded.
run_call
Answers one call against a Rust engine.
start_options
A start’s options from a call’s arguments.
summary_json
A run’s summary as calls carry it.
unbase64
Decodes standard base64.
wire_options
A start’s options as calls carry them.

Type Aliases§

CallFuture