Overview

There can be various types of nodes. We first suggest to read the general instructions on how to work with nodes here, and then jump to the specific instructions on working with each particular node, such as LLM node, Semantic Search node, Semantic Switch node, etc.

Naming nodes

Every node has a name. This:

  • Is required, when calling deployments, to direct inputs to the correct input nodes and correctly parse the response
  • Is required for proper integration with datasets and evaluations
  • Is a utility for you when analyzing logs and traces.

All nodes names within a pipeline must be unique.

Connecting nodes – Handles

To connect nodes, use Handles, which are small holes on the left or right side of each node. Connect the nodes by dragging a connection from one node’s output handle to another node’s input handle.

Input handles appear on the left side of a node; output handles are on the right side of a node. Depending on the node type, there can be 0 or more input handles and 0 or more output handles.

Node connections are many-to-many, conforming to the following rules:

  • One-to-one connections are synchronous.
  • If a node output is sent to more than one input on other nodes, it will be sent in parallel at the same time.
  • If a node awaits multiple inputs on different handles, it waits until all of them are executed.
  • If multiple nodes are connected to the same handle on a node, then it waits until the first arriving input. This is useful in conditional competing flows and loops

Handle types

Depending on the data the node expects, there are different types of handles.

  • String – basic text input
  • ChatMessageList – JSON array of ChatMessage objects in chronological order of the chat conversation. ChatMessage has 2 required fields: role and content. role is a string, normally "user", "assistant", or "system", but may vary depending on the LLM provider. content is string content of a message.
  • Any – either of the above. Normally, used in the nodes that are pass-through or can take any output.

Conditional output handles

For some nodes, including Semantic Switch node, the result of the node execution (and hence the entire pipeline flow) will be directed to just one of the outputs. The selection depends on the node configuration and on the input data it receives.

Dynamic inputs

For relevant nodes, e.g. LLM node, we allow the system message to be templated with the user input for each call. This is achieved with enclosing your {{variables}} in double curly braces, a.k.a mustache syntax. To start, simply enclose a word in your node’s “prompt” field in doubly curly braces. After that, a new input handle of type String, named with that enclosed word, will appear on the left hand side of the node. At run time, each of the variables is replaced dynamically by values that are passed to their respective handles.

Read more about variable requirements in: String template node and JSON extractor node

Loops and cyclic flows

Laminar supports cyclic flows that can power retries and agentic behaviours. To build a loop, simply connect an output of one of the nodes to the input of a different node. This makes the most sense in flows that include conditional nodes.

a cyclic flow with LLM, route, and string template node