node
Creates a FunctionNode that runs block, which uses context.state, context.updateState and requestInput. An edge into it builds only if the predecessor's output schema fits its input schema; inferred output schemas require every field, inferred input schemas only fields without defaults.
For example, an output DefOrder(id, total, qty = 1) feeds an input ReqOrder(id, total, qty): the output always carries qty, which the input requires.
Explicit schemas apply each run, except to a rejected confirmation's output and to a requestInput answer used as the output.
The block's return value, a Content included, is the node's output; emitting an event with an output or calling Context.setOutput fails the node. A node that talks to an agent node sends the message with emit(content). A node has no auth configuration.
Parameters
The node's name, required: non-empty and without '/', '@' or '.'.
Checks the input as it arrives, before I's defaults apply; an Any? port then gets the checked value.
Whether a resume runs the node again rather than using the resuming answer; unset, it is true when requireConfirmation is true.
Whether each run first asks the user to approve it: pass true, or a predicate that decides for each input. The request's payload holds the input's JSON form as args; a rejected run skips the block and outputs {"error": "This tool call is rejected."} unchecked; the answer is in Context.toolConfirmation.
Throws
if name is empty or contains '/', '@', or '.'.
if I or O, or a type argument inside it, is a sealed type, a nested ByteArray, or has no usable serializer and is not Content, Event, Any, or Unit, or if requireConfirmation is true with rerunOnResume = false.
Creates a FunctionNode as the other node overload does, asking the user to approve a run only when requireConfirmation returns true for its decoded input.
Parameters
Whether a resume runs the node again rather than using the resuming answer; unset, it is true.
Decides for each input whether a run asks the user to approve it; it runs on each run that has no answer yet, and once the node has asked, the answer decides. A rejected run outputs as the other node overload describes.