Node Types¶
Note
See cookbook for example usage.
LLM¶
Use an LLM to respond to the node input. This node can be configured with a prompt to give the LLM instructions on how to respond. It can also be configured to use tools which enable it to perform additional actions.
Routers¶
Router nodes allow you to route the input to one of the linked nodes. This is useful if you want your bot to behave differently depending on the input or some persistent context. For example, you might want to route the input to a different node if the user is asking for help with a specific topic.
Router nodes share some common configuration such as the list of route options. Router nodes can also be configured to
tag the output message with the selected route. This is useful for debugging and for tracking the flow of messages through the pipeline.
The format of the tag is <node_name>:<route_name> where <route_name> is the name of the route selected by the router node.
Router Keywords Are Uppercase
All router keywords are automatically converted to uppercase. When configuring router outputs, use uppercase keywords to match this behavior. Keyword matching is case-insensitive, so "HELP", "Help", and "help" will all match the same route.
LLM Router¶
Routes the input to one of the linked nodes using an LLM. In this case, the LLM acts as a classifier using the prompt provided to classify an incoming message into a set of discrete categories that allow messages to be routed.
The outputs listed by the node are the available classification labels. These should match the classification categories specified in your prompt. They can be adjusted through the Advanced settings for the node. The top output, which is prepended by a blue * is the default label. In the event that the LLM generates a response outside of the specified outputs, the route with the default label will be taken.
Best practices for configuring a LLM Router
It is advisable to use the Node history mode for an LLM Router to avoid unintentionally supplying few-shot examples to the node with an incorrect output format.
Static Router¶
The Static Router node allows you to route the input to one of the linked nodes based on the value of a specific key in the data source. This is useful if you want your bot to behave differently depending on the value of a specific key in the data source.
The data source can be any of the following:
The key should be a name of a field in the data source and supports selecting nested fields via the <field>.<subfield> syntax. For example, if the data source is a JSON object with the following structure:
You can select the name field using the key user.name and the age field using the key user.age.
If the field is not present in the data source, the router will not route the input to the first linked node.
Assistant¶
Use an OpenAI assistant to respond to the input.
Python Node¶
Execute custom Python code for logic, data processing, and external API calls. See the Python Node page for full documentation including utility functions, the HTTP client, state management, and attachments.
Template¶
Renders a Jinja template.
Available Template Variables¶
The following variables are available in the template context:
| Key | Description | Type |
|---|---|---|
input |
The input to the node | String |
node_inputs |
The list of all inputs to the node in the case of parallel workflows | List of strings |
temp_state |
Pipeline temporary state | Dict |
session_state |
Session state | Dict |
participant_details |
Participant details (identifier, platform) |
Dict |
participant_data |
Participant data | Dict |
participant_schedules |
Participant schedule data | List |
Sample Template¶
Input: {{ input }}
Node Inputs: {{ node_inputs }}
Temp State Key: {{ temp_state.my_key }}
Participant ID: {{ participant_details.identifier }}
Participant Platform: {{ participant_details.platform }}
Participant Data: {{ participant_data.custom_key }}
Schedules: {{ participant_schedules }}
Email¶
Send the input to the specified list of email addresses. This node acts as a passthrough, meaning the output will be identical to the input, allowing it to be used in a pipeline without affecting the conversation.
Extract Structured Data¶
Extract structured data from the input. This node acts as a passthrough, meaning the output will be identical to the input, allowing it to be used in a pipeline without affecting the conversation.
Update Participant Data¶
Extract structured data and save it as participant data.