# The Start Node: Inputs and State Variables — OpenAI Agent Builder Workflows

Source: https://www.skillbyai.com/en/openai-agent-builder/b-start

> Define what a run receives and what it remembers.

## Typed inputs, explicit state

A workflow begins at a **start node** that defines the **inputs** for a run (typically the user's message, sometimes extra variables such as a customer ID or language) and the **state variables** the workflow will keep. Define them explicitly with sensible types and defaults. Avoid stuffing everything into one free-text message: a separate `customer_tier` or `locale` variable is easier to route on, test and log than something an agent has to infer from text. Product details such as node names and menus change; check the current OpenAI documentation.

## Start, agent, tools, end

Most workflows combine a start node with inputs, agent nodes, tools and an end node with a defined output.

![Four ideas: inputs, agents, tools, outputs.](assets/figures/openai-agent-builder/section-2-map.svg) — Figure 2.1 — Inputs, agents, tools and outputs.

## An input and state design

Name and type everything that routing depends on.

```text
inputs:
  input_as_text: string          # the user message
  customer_id:   string          # from your app, not from the user
  locale:        string = "en"
state:
  category:      "billing" | "technical" | "other" | null
  attempts:      number = 0
  approved:      boolean | null
```

## Pass identity from your app

Supply user or customer IDs from your authenticated backend, never from the chat text, so a user cannot claim to be someone else.

**Quiz:** Why define routing-relevant values as explicit variables?

- [ ] Variables make the model larger
- [x] They are easier to route on, test and log than values inferred from text
- [ ] Agents cannot read text
- [ ] It removes the need for an end node

*Answer:* They are easier to route on, test and log than values inferred from text. Explicit state beats guessing.
