Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

AI Agents · Const

START

START is LangGraph.js's virtual beginning node. Use it to connect graph input to the node or nodes that should execute first.

How it works

START is a special virtual node representing the beginning of graph execution. Connect it with addEdge to choose the first node, or with addConditionalEdges when the entry point depends on routing logic.

Syntax

import { START } from "@langchain/langgraph";
graph.addEdge(START, "nodeName");

Key points

  • START marks the boundary where input enters the graph.
  • Use START primarily to select the graph's initial node or nodes.
  • A fixed entry route is declared by adding an edge from START to a node.
  • Conditional routing from START supports different initial destinations.
  • The configured entry point runs first when graph execution begins.

Common mistakes

  • The edge must identify the graph's entry node or nodes; START itself is not an application node.

Example: Connect START to the first node

import { START, StateGraph, StateSchema } from "@langchain/langgraph";

const State = new StateSchema({
  message: z.string().default(() => ""),
});

const graph = new StateGraph(State)
  .addNode("nodeA", () => ({ message: "started" }))
  .addEdge(START, "nodeA")
  .compile();

The edge from START makes nodeA the graph's entry point.

When to use it

Fixed entry point

A graph has one deterministic first processing step.

Conditional entry routing

Initial routing depends on the incoming state.

Input handoff

A graph needs an explicit boundary between input and application nodes.

Interview questions

QWhat is START in LangGraph.js?

START represents the beginning of graph execution and routes user input into the graph. Referencing it lets you determine which node or nodes run first.

Follow-up: How can entry selection depend on runtime state? Use addConditionalEdges from START so a routing function selects the initial destination.

QHow do you define a graph entry point?

Use addEdge(START, "nodeA") to connect the virtual START node to a named node. This establishes nodeA as the first node executed.

Follow-up: What should be used when there are multiple possible initial nodes? Use addConditionalEdges from START rather than a fixed edge.

QWhen would you use conditional edges from START?

A fixed entry point uses addEdge from START, while conditional entry uses addConditionalEdges from START. Both approaches specify where graph execution enters.

Follow-up: Why is START useful even though it is virtual? It provides an explicit graph boundary for routing initial user input.

  • StateGraph
  • addEdge
  • addConditionalEdges
  • END

Source: Graph API overview. Checked 2026-10-15.