The engine resolves its acting identity from this client's token and
caches the resolution per client object — the client's auth must be
stable for the engine's lifetime. To act as someone else, construct
an engine over a client bound to their token (withConfig({token})),
never mutate this client's auth in place.
Any configured apiVersion works: every verb derives its working
client onto ENGINE_API_VERSION, on the raw namespace as much as
through createEngine — see WorkflowClient.withConfig.
OptionalexecutionDeclared execution context — the advisory "via what" stamped on every
history entry alongside the token-resolved actor. Construction-scope
configuration, never per-call: the runtime half is always inferred, and
the declared {kind, id} half labels the host (see EXECUTION_KINDS).
Omitted ⇒ runtime-only stamps.
OptionalidempotencyHow long a recorded idempotencyKey dedupes retries (the
processedRequests[] row's lifetime). Default 24 hours. Size it to the
caller's longest retry horizon — a retry arriving after the row expired
re-executes the operation.
OptionalresourceOptional routing override for cross-resource reads (subject + ancestor
docs that live in a different Sanity resource than the workflow). Called
with a parsed GDR; return a client for that resource, or undefined to let
the engine route it — client for the workflow resource itself, a
sibling derived from client's credentials for anything else. A served
resource is also part of the declared surface for runtime-supplied refs.
Engine-scope configuration — see CreateEngineArgs.
Engine-scope environment partition — required. See validateTag + tags.ts.
The Sanity resource the engine's own data lives in. Used to mint
GDR URIs for every doc the engine writes (definitions, instances,
ancestor refs). Mirrors @sanity/client's ClientConfigResource.
The engine-scope bindings pinned once by
createEngineand carried explicitly on every rawworkflow.*call.Enginemethods never take these — they were supplied at construction.