Numeric Input

Numeric Input in AgenticFlow AI

What is a Numeric Input?

A Numeric Input is an input component that allows you to enter a numeric value, ensuring that it is treated as a number rather than a string. This value can be provided by the user or fetched later from an uploaded dataset during a bulk-run.

When to Use the Numeric Input Component

The Numeric Input component is ideal for situations where numerical data is required for analysis or operations that involve arithmetic or counting. For example, you might use it to specify the number of iterations for a loop or to set a threshold value for a process.

How to Add a Numeric Input to Your Custom Workflow

The Numeric Input component is listed under User Inputs. You can add it to your workflow using the main section or the sidebar.

Adding a Numeric Input

  1. Navigate to the Workflow page.

  2. Click on + Create Workflow or select an existing workflow.

  3. In the empty state or within your workflow, click on + Add Input.

  4. Select Numeric Input from the list of input components.

Numeric Input Settings

Title

The title of your input component.

Description

Provide a description to explain what this input is for. This helps users understand the purpose of the input.

Variable Name

Located at the bottom left and marked in green, you can rename the variable. Use this name to access the data in your workflow.

Optional/Required

Located at the top right, indicating whether the input is mandatory for the workflow to run:

  • Optional: The input is not required for the workflow to function.

  • Required: The input must be provided before the workflow can start.

Setting a Default Value

To set a default value for a Numeric Input component:

  1. Enter the value in the input field.

  2. Click on the small setting icon at the bottom right.

  3. Click on Set Current Value to save the default value.

Ensure the entered value is a number and, when used in a code step, it should be treated as a number.

Accessing the Entered Number

To access the entered number, use the variable name within double curly braces {{}}.

For example, if the variable name is threshold, you can access it as:

  • {{threshold}} in most workflow steps.

  • params.threshold in a JavaScript step.

Example Usage in a Prompt:

Filter the dataset to include only entries where the value exceeds {{threshold}}.

Practical Example

Example Workflow: Setting a Sales Target

  1. Add a Numeric Input:

    • Title: "Sales Target"

    • Description: "Enter the sales target for the quarter."

    • Variable Name: sales_target

  2. Add a Text Input:

    • Title: "Sales Data"

    • Description: "Upload the sales data CSV file."

    • Variable Name: sales_data

  3. Add an LLM Action:

    • Prompt:

      Based on the uploaded sales data, identify the top-performing regions where sales exceed {{sales_target}}.
  4. Run the Workflow:

    • Save the workflow.

    • On the App page, enter the sales target (e.g., 50000) in the Numeric Input field and upload the sales data file.

    • Run the workflow to see the analysis.

By following these steps, you can effectively utilize Numeric Input components in your workflows to capture and process numeric values, enhancing the capabilities of your AI-driven automation in AgenticFlow AI.

Last updated