Skip to main content
This template demonstrates how to use Custom Nodes with more than one input in a graph. This is possible because you can pass an arbitrary number of inputs to a Custom Node’s process() method. In our example, we’ll ask two LLMs to write a poem, and then pass both outputs to a third LLM to choose which poem is better. This results in a graph which can be visualized like this:
Architecture
  • Backend: Inworld Agent Runtime
  • Frontend: N/A (CLI example)

Prerequisites

Getting Started

  1. Clone the templates repository:
  2. In that project folder, run npm install to download the Inworld Agent Runtime and other dependencies
  3. Create an .env file and add your Base64 Runtime API key:
.env
  1. Create a new file called multi-input.ts and paste in the following code:
multi-input.ts
  1. Run npx ts-node multi-input.ts to run the graph, observing both the poems and the review