Nodes

Nodes are the building blocks of MindedJS flows - discrete processing units that handle different aspects of your agent's workflow.

Node Types Overview

Node Type
Purpose
Description

Entry Points

Start flows from various sources

LLM Processing

Generate responses using language models

Actions

Execute external functions and APIs

Flow Control

Route and organize flow logic

Flow Control

Jump to specific nodes or subflows

Trigger Nodes

Trigger nodes are entry points that start your flows and initialize them with memory and messages.

Trigger Types

App Trigger

- type: trigger
  triggerType: app
  name: zendesk-ticket-created
  displayName: Zendesk Ticket Created
  appTriggerId: zendesk-new-ticket

Webhook Trigger

Trigger Implementation

Handle triggers in your agent code:

Prompt Nodes

Prompt nodes process input through LLM to generate intelligent responses or invoke tools. Prompt nodes are commonly used to notify and collect information.

Use Cases

  • Notify the user about the result of a previous node.

  • Collect information from the user.

  • Invoke (scoped) tools.

Handle AI message

  • Prompt nodes usually result in an AI message being sent to the user. Use the agent.on(AgentEvents.AI_MESSAGE, callback) event handle to route the message according to user requirement (e.g. send email, slack message, update Jira ticket etc).

  • In development mode (playground), the message is automatically shown in the chat regardless of the message handler.

Context

  • Prompt nodes automatically have access to previous nodes' output as context.

  • You can also inject context from the memory object using the {memory.propertyName} placeholder.

Properties

  • humanInTheLoop?: boolean - When true, pauses execution after this node for human input before continuing. Use this property only if you need to gather an input from the user. Usually combined with a promptCondition edge to allow for iterative processing over human input.

  • canStayOnNode?: boolean - When true, allows the node to route back to itself for iterative processing. Usually combined with humanInTheLoop: true to allow for iteration over human input.

  • prompt: string - The prompt to be sent to the LLM. The prompt is an instruction for what AI message to generate or a (scoped) tool to invoke. This is not general instruction for what the agent should do (e.g. "wait for x").

  • sendAiMessage?: boolean - When false, the AI response is processed internally without sending to the user. Default: true. Set to 'false' for internal calculations, reasoning, or decision-making logic that shouldn't be visible to users.

Limitations

  • Prompt nodes can not save information to memory directly. Rather the user & agent messages are stored in the messages array of the state object. Making user's input available to the next prompt nodes or tools in the form of input schema.

  • Image recognition is only supported when a user attaches an image to the message. If you need to extract information from an image, use a tool with agent.llm to process the image. Return the result in the tool response so following prompt nodes can use it.

  • By default, prompt nodes send a message to the user. Set sendAiMessage: false if you want internal processing without user-facing output.

Prompt examples

  • "Draft a professional email to the merchant requesting verification of the dispute"

  • "Ask the user for their contact information (name, email, phone)"

Common Prompt Patterns

Extract Information from User

Use humanInTheLoop: true and canStayOnNode: true with promptCondition edges for iterative information gathering:

Notify User

Use standard prompt nodes with stepForward edges for one-way notifications:

Custom LLM Configuration

Provide a custom LLM configuration to the prompt node using the llmConfig property.

Internal Processing (No User Message)

To process logic internally without sending a message to the user, set sendAiMessage: false:

Use cases for sendAiMessage: false:

  • Internal calculations and reasoning: Determining refund amounts, calculating discounts, analyzing data

  • Decision-making logic: Evaluating conditions before taking actions

  • Information extraction: Processing and structuring data for subsequent nodes

  • Pre-processing: Preparing inputs for tools or other nodes

The AI response is added to conversation history and available to subsequent nodes, but not sent to the user.

Tool Nodes

Tool nodes execute functions to perform actions like API calls or database queries.

Basic Tool Node

Junction Nodes

Junction nodes provide flow control without processing, useful for organizing routing logic.

Basic Junction

Routing Example

Jump To Nodes

Jump To nodes provide direct navigation to specific nodes, enabling flow transitions and subflow execution.

Basic Jump To Node

Cross-Flow Navigation

Jump To nodes enable navigation between flows. Target nodes can exist in different flow files, and state is preserved during jumps:

Best Practices

  • Use descriptive names: technical-support-specialist not agent-1

  • Keep prompts focused: Define specific roles and context, avoid overly broad prompts

  • Always include displayName: Required for prompt nodes, recommended for all nodes

Browser Task Nodes

Browser task nodes allow your agent to interact with web pages using AI-powered automation.

Basic Browser Task

Custom Model

Specify which AI model to use (default: gpt-4o):

Next Steps

  • Edges - Connect nodes with intelligent routing

  • Tools - Build powerful tool functions

  • Memory Types - Design effective state management

Nodes are your building blocks - combine them strategically to create powerful AI workflows! 🔧

Last updated