Node Handles & Routing
Last updated
Last updated
Output handles enable data transfer between nodes. They are automatically generated from Python return statements. To change the output handles, you need to modify the code.
Each node has at least one handle output (called "output"). If you return a value like this: return some_data
, it will assign the output name to that output. To create a custom output item, return an object with the handle name as the key, like this: return { 'handle_name': some_data }
.
Data between nodes is passed as a dictionary object. Each node receives a data
object containing the output from connected nodes. The input data is structured as data['node_id']['handle_title']
, where node_id
is the unique identifier of the connected node and handle_title
is the title of the specific handle on that node.
Each node has a unique ID, visible in the bottom right.
The workflow's flow is controlled by the presence or absence of specific keys in the return statements. Nodes connected to handles that are not returned will not be executed.
In the example below, if all other data is unavailable, only the nodes connected to the no_data_available
handle will be triggered.
If a node does not return a specific key, the nodes connected to that key will not be triggered. You can use if statements to conditionally manage the workflow's execution.
Return statements for handles must be at the top level; any return statement keys inside an internal function will be ignored.