How a flow is built from nodes

The shape every flow has — an entry, the decisions, the model call and the answer — and a table of every node of the builder.

3 min read

A flow is a graph that decides what a request may spend. Its nodes are the steps of that decision, and the connections between them say which step comes next. This page shows the shape every flow has and lists every node the builder knows.

From a request to an answer

  • Request — Default → AI Model
  • AI Model — Success → Return Response
  • AI Model — Deny → Reject Request

A request names an operation code, and the flow bound to that code runs. One run of a flow is an execution. It starts at the entry node and moves from node to node along the connections, one node at a time, until a node ends it.

  • Request is the entry node. The request comes in here, and a flow has exactly one.

  • The nodes in the middle decide. They check a budget, look in the cache, compare a field of the request, wait for a person. Each of them leaves through one of its ports, and the port chooses the branch — see Ports and branching.

  • AI Model calls a model. It is the only node that spends money.

  • Return Response and Reject Request are the terminal nodes. The first answers the caller, the second refuses the request with an error code. An execution that ends at the first is completed, and one that ends at the second is rejected.

What every flow must have

A flow is checked when it is published. A flow that breaks one of these rules is not published.

  • It has one entry node, and only one.

  • Every path ends at a terminal node.

  • No connection leads back to a node the path has already passed. A flow runs forward.

  • Every required port of every node is connected.

  • Estimate Cost, Budget Check and Reserve Budget lead to one model call, and Capture & Release follows its Success port — The money chain gives their rules.

A node that cannot be reached from the entry node does not stop the publication. The check warns about it. Publish checks lists every check with its code.

The groups of the palette

The builder files its nodes under groups, in the order a request usually meets them.

GroupWhat its nodes are for
EntryThe point where the request comes in
MoneyThe steps around the money of a call — its expected cost, the budget check, the hold and its settlement, the approval of a person
DecisionChoosing a branch, reshaping data, leaving a note in the trace
CacheAnswering from the cache instead of paying for the same answer again
ModelCalling a model, and marking the path taken when the first choice is refused
OutputAnswering the caller, refusing the request, or waiting before the flow goes on

One node, Http Request, is frozen unless the service is set up otherwise. A version published with it keeps working, and the palette no longer offers it. A new version may not have it: a draft that holds the node is not published until the node is taken out. Http Request says what the node does in a version published with it.

Every node

NodeTypeCategoryPorts
Request sdk_requestEntrydefault
Estimate Cost estimate_costMoneydefault
Budget Check budget_checkMoneydefault, deny
Reserve Budget reserve_budgetMoneydefault
Capture & Release capture_releaseMoneydefault
Require Approval require_approvalMoneyapproved, rejected
Condition conditionDecisionmet, not_met
Trace Note logDecisiondefault
Transform transformDecisiondefault
Cache Lookup cache_lookupCachehit, miss
Cache Write cache_writeCachedefault
AI Model ai_modelModelsuccess, error, rate_limit, deny
Fallback fallbackModeldefault
Return Response return_responseOutputNone
Reject Request rejectOutputNone
Queue queueOutputdefault
Http Request Frozenhttp_requestOutputdefault, error

Where to go next

  • Ports and branching — which ports a node has, which of them must be connected, and what an unconnected one does.

  • AI flows — how a request finds its flow, and the states a flow goes through.

  • Glossary — an operation code, a version, an execution.

  • Open a flow on AI Flows, or start from a ready one on Templates.

Built from openapi b070e1f, sdk contract 6a2e0e0, php 4089db3, node 0fa87be