Request
The entry node of a flow — where a request comes in and hands its input to the next node.
2 min read
Request is where a flow starts. A request to the flow comes in here, and the node hands its input on to the next node.
- Node
- Request
- Type
sdk_request- Category
- Entry
- Ports
- Default
defaultmust be connected
- Default
- Ends the path
- No
What it does
A request names an operation code, and the flow bound to that code runs from this node. The node passes the input of the request on as it came and leaves through Default. It checks nothing and spends nothing.
A flow has exactly one entry node. Once it is on the canvas, the palette turns its row off.
A request sent in async mode is accepted before the node runs. A worker then starts the execution here.
The context of the call does not go through the node: every node reads it by its path. Execution context and paths says what the roots hold.
Send a request shows the request from the side of the application: the operation code, the input and the context.
When to use it
Every flow begins with it, and every template of the gallery has one.
The input has no schema. The first check of it is made by the first AI Model the execution reaches: without a non-empty input.messages the execution ends with invalid_flow_input, and the nodes before the model have run by then. To refuse a request that has no input.messages before anything else runs, put a Condition with the operator exists on that path right after the entry node, and lead its Not met to a Reject Request.
Settings
The node has no settings.
Ports
The node has one port, Default, and it is required. A flow in which it leads nowhere is not published. No connection may lead into the entry node: the canvas refuses one.
Output
The output of the node is the input of the request, unchanged. A later node reads nodes.<key>.output.<name>, where <key> is the key of this node — the same value as input.<name>.
Errors
The node raises no error of its own. Two codes of the publish check are about it: no_entry_node when a flow has none, and multiple_entry_nodes when it has more than one.
A request that finds no flow to run is answered 404 with the code flow_not_found: no flow is bound to the operation code, or the flow bound to it has no published version or is archived.
Example
- Request — Default → Condition
- Condition — Met → AI Model
- Condition — Not met → Reject Request
- AI Model — Success → Return Response
Condition tests that input.messages exists. A request without them is refused by Reject Request before the model is called; any other one is answered by Return Response with what the model said.
Related
Execution context and paths — what the input, the context and the outputs of nodes hold.
Send a request — the request that starts an execution.
How a flow is built — the entry node among the other nodes.
AI Model — the node that takes its messages from
input.messages.
Built from openapi b070e1f, sdk contract 5cc7055, php ae4a53b, node 84bc62d