> For the complete documentation index, see [llms.txt](https://docs.agenticflow.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agenticflow.ai/workflows/workflow-inputs/number-input.md).

# Number Input

A **Number Input** is an input control that allows a user to enter a numeric value. This ensures the input is treated as a number, not a string, making it suitable for calculations, comparisons, and other numerical operations.

## When to Use

This control is ideal for any input that requires a number, such as:

* A quantity or count (e.g., number of articles to generate).
* A threshold or limit.
* A score or rating.
* Any value that will be used in a mathematical calculation.

## How to Add

1. From your workflow's **Build** page, click on **+ Add Input**.
2. Select **Number Input** from the list of available controls.

## Configuration

* **Title:** The main label for the input field.
* **Description:** Optional helper text to provide more context.
* **Variable Name:** The name used to access this input's value.
* **Optional/Required:** A toggle to specify if the user must provide this input.

## Setting a Default Value

You can pre-fill the Number Input with a default value:

1. Enter the desired default number into the input field.
2. Click the settings icon (⚙️) at the bottom right of the control.
3. Select **Set Current Value as Default**.

## Accessing the Value

You access the value using its variable name in double curly braces `{{}}`. For example, if the variable name is `item_count`:

* **In most nodes:** Use `{{item_count}}`.
* **In a Code Node (Python):** The value will be injected as a string, so you may need to convert it to a number, e.g., `count = int("{{item_count}}")`.
* **In a JavaScript step:** Access via `params.item_count`.

### Example

**Goal:** Generate a specific number of new product ideas.

1. **Add a Number Input:**
   * Title: "Number of Ideas"
   * Variable Name: `num_ideas`
   * Default Value: `5`
2. **Add a Text Input:**
   * Title: "Product Category"
   * Variable Name: `category`
3. **Add an OpenAI MCP Node:**
   * **Action:** `Chat`
   * **Prompt:** `Generate a list of {{num_ideas}} new product ideas for the following category: {{category}}.`

When this workflow runs, it will use the number provided in the "Number of Ideas" input to generate the requested number of product ideas.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.agenticflow.ai/workflows/workflow-inputs/number-input.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
