---
sourceDocument: Yokohama Build workflows
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/build-workflows

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# Dynamic inputs

# Dynamic inputs {#ariaid-title1}

Release version: Yokohama  
Updated February 5, 2025  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Dynamic inputs

Dynamic inputs in ServiceNow Flow Designer enable action authors to generate lists of inputs or input values dynamically when configuring an action in a flow.
These inputs can reflect related action inputs, record fields, or available choice options, allowing flows to adapt to changing data without manual updates.
Dynamic inputs require the Integration Hub plugin and are not available in the base system.
They provide flexibility for flow authors to work with data that may vary at runtime, especially useful in integrations with third-party systems.
Show full answer Show less  

## Types of Dynamic Inputs

* **Dynamic Choice:** Gathers choice values dynamically to present selectable options.
* **Dynamic Inputs:** Collects arbitrary additional action inputs to include in an action.
* **Dynamic Template:** Retrieves fields from a dynamically selected record type, allowing flow authors to select fields without needing to update the action for schema changes.

## How Dynamic Inputs Work

Using dynamic inputs involves three steps:

1. Action authors create a **data gathering action** that generates the dynamic data.
2. They then create an action with a dynamic input configured to call this data gathering action.
3. Flow authors add this action to a flow and configure it with the dynamically retrieved data.

## Data Gathering Actions

Data gathering actions fetch data, often via REST calls to third-party systems, and provide JSON output formatted with a `data` property. These actions must have a script step returning a single JSON output named `output`. The JSON data should be limited to 5000 items for dynamic choices or templates to avoid performance issues. The default timeout for data gathering actions is 300 seconds but can be adjusted globally via a system property. These actions are designed to be called by dynamic inputs, not added directly to flows.

## Supported Input Data Types

Dynamic inputs support various ServiceNow AI Platform data types. Examples include:

* Choice
* Datetime
* Decimal
* Duration
* Email
* HTML
* Integer
* Password2
* Reference
* String

Each input type requires JSON formatted data specifying labels, names, types, and optionally default values or choices.

## Best Practices and Guidelines

* **Use dynamic inputs for third-party integrations:** They enable flows to dynamically fetch relevant data from external endpoints.
* **Manage timeout settings carefully:** Avoid long timeouts for interactive flows to maintain responsiveness.
* **Watch for scripting errors:** Data gathering actions rely on scripts that must output well-formed JSON; errors can prevent inputs from loading.
* **Limit dynamic inputs to 40 input values:** To prevent memory issues and rendering errors due to large JSON objects.
* **Limit JSON output for dynamic choices/templates to 5000 items:** To avoid performance degradation and ensure smooth rendering.

## Getting Started

ServiceNow provides sample actions that demonstrate the use of dynamic inputs with all supported types. Customers should create data gathering actions tailored to their use cases---for dynamic choices, templates, or arbitrary input collections---and configure dynamic inputs to call these actions within their flows.  
Generate a list of action inputs or input values each time that someone configures the action in a flow. Dynamic inputs can display a list of related action inputs, a list of fields from a record, or a list of options available in a choice list.
Note:  
Dynamic inputs are not available in the base system. To use dynamic inputs in Workflow Studio, you must [Request an Integration Hub plugin](https://www.servicenow.com/docs/access?context=request-integrationhub&version=yokohama&pubname=yokohama-integrate-applications&ft:locale=en-US). Dynamic inputs are part of the ServiceNow Flow Designer - Introspection \[com.glide.hub.flow_designer_introspection\] plugin.  
During flow design, dynamic inputs retrieve values and display them as inputs within an action dynamically. These types of dynamic inputs are available to action authors.git/yokohama/doc/source/administer/flow-designer/task/use-flow-designer-help-panel.dita

Dynamic Choice
:   The Dynamic Choice type input gathers a list of choice values to display. For more information on building a dynamic choice, see [Create a data gathering action for a dynamic choice](https://www.servicenow.com/docs/cjIgPUIe6Udo_8vMGcSmQw "Create a data gathering action to generate a list of choice options for a dynamic choice input.").

Dynamic Inputs
:   The Dynamic Inputs type input gathers a list of additional action inputs to display. Use Dynamic Inputs to add arbitrary inputs to an action. For more information on building dynamic inputs, see [Create a data gathering action for a dynamic inputs type input](https://www.servicenow.com/docs/FK956UTV7saAtcow7zH_VQ "Create a data gathering action to create arbitrary action inputs using a dynamic inputs type input.").

Dynamic Template
:   The Dynamic Template type input gathers a list of fields from a dynamically selected record type. Flow authors can then select which fields to include in their flow. Because the list of fields is dynamically generated,
you don't have to change the action when fields are added or removed from the source table. For more information on building a dynamic template, see [Create a data gathering action for a dynamic template](https://www.servicenow.com/docs/nv69t~CqfBYBIIEJYQVZvw "Create a data gathering action to collect record field values for a dynamic template input.").  
There are three general steps to using dynamic inputs.

1. An action author creates a data gathering action to generate dynamic data.
2. An action author creates an action with a dynamic input and configures the dynamic input to call the data gathering action.
3. A flow author adds the action to a flow and configures the action with dynamically gathered data.
{#dynamic-inputs__ol_qn1_nwl_mjb}

## Data gathering actions {#dynamic-inputs__section_dbr_x1b_chb}

A data gathering action collects data to be used by other actions. Data gathering actions are intended to be called from dynamic inputs rather than be added directly to a flow. Data gathering actions typically collect data from third-party systems using a REST call. All data gathering actions must meet these requirements and constraints.

* The action has a [script step](https://www.servicenow.com/docs/_J8dNr_d5ZR8N5xKljEKSg "Add custom JavaScript to execute within a reusable action. While most core actions and steps fit common use cases, you can build a Script step to execute behavior not satisfied by the core steps.") that contains an output variable of type JSON.
* The action has an output named output of type JSON whose value is derived from the script step's JSON output variable.  
  Note:  
  The action can have multiple outputs but can only have one of type JSON.
* The script step formats the JSON output to have a property named `data`.
* The JSON output should not return more than 5000 choice options, field template values, or array element items when the data is intended for a dynamic choice or a dynamic template input.  
  Note:  
  Dynamic choice and dynamic template inputs can only display up to 5000 choice options or 5000 template values from the JSON output.
* The action waits for up to 300 seconds (5 minutes) to gather data before it times out.  
  Note:  
  To change the timeout period for all actions, modify the value of the sn_flow_designer.sync_action_execution_timeout_in_seconds system property.
{#dynamic-inputs__ul_g5h_ly1_chb}

## Supported dynamic input data types {#dynamic-inputs__id_l4c_q5h_xcc}

Dynamic inputs support a limited number of ServiceNow AI Platform data types. You can use the example JSON to build your own dynamic inputs. You can change the values of the label and name properties to met your needs. The type property must specify a ServiceNow AI Platform data type name. For more information about ServiceNow AI Platform field data types and how to configure them, see [Field types reference](https://www.servicenow.com/docs/access?context=r_FieldTypes&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US).  
{#dynamic-inputs__table_xv2_2lh_xcc__entry__2}

| Input data type | Example JSON |
|-|-|
| [Choice](https://www.servicenow.com/docs/access?context=c_ChoiceLists&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) | { data: [{ label: 'Choice type input', name: 'choicetype', defaultValue: 'choice_1', type: 'choice', choices: [ { label: 'Choice 1', value: 'choice_1' }, { label: 'Choice 2', value: 'choice_2' } ] }] } |
| Datetime | { data: [{ label: 'Datetime type input', name: 'datetimetype', type: 'datetime', }] } |
| Decimal | { data: [{ label: 'Decimal type input', name: 'decimaltype', type: 'decimal', }] } |
| Duration | { data: [{ label: 'Duration type input', name: 'durationtype', type: 'duration', }] } |
| Email | { data: [{ label: 'Email type input', name: 'emailtype', type: 'email', }] } |
| [HTML](https://www.servicenow.com/docs/access?context=c_UseHTMLFields&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) | { data: [{ label: 'HTML type input', name: 'htmltype', type: 'html', }] } |
| Integer | { data: [{ label: 'Integer type input', name: 'integertype', type: 'integer', }] } |
| Password 2 | { data: [{ label: 'Password2 type input', name: 'password2type', type: 'password2', }] } |
| [Reference](https://www.servicenow.com/docs/access?context=c_ReferenceField&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) | { data: [{ label: 'Reference type input', name: 'referencetype', reference: 'sys_user', type: 'reference', }] } |
| String | { data: [{ label: 'String type input', name: 'stringtype', defaultValue: 'abcdef', type: 'string', mandatory: true }] } |
[Table 1. Dynamic input data types supported]

{#dynamic-inputs__table_xv2_2lh_xcc}

## General guidelines {#dynamic-inputs__id_pd4_1vb_ptb}

Consider dynamic inputs for third-party integrations
:   Dynamic inputs let you create flows that fetch data dynamically from external sources. In third-party integrations, dynamic inputs can provide data values that pertain to a particular endpoint. For more information on
    setting up third-party integrations with Workflow Studio, see [IntegrationHub](https://www.servicenow.com/docs/access?context=integrationhub&version=yokohama&pubname=yokohama-integrate-applications&ft:locale=en-US).

Be aware of the time required to retrieve large amounts of data
:   By default, dynamic inputs have up to 300 seconds to gather data before they time out. If your data gathering action needs more time to gather data, set the
    sn_flow_designer.sync_action_execution_timeout_in_seconds system property to a higher value. However, don't use long timeout values for interactive flows where an end user must enter or select a
    value.

Be aware of scripting errors
:   Because all data gathering actions use a script step, potential errors could occur from scripting. When using scripts to output JSON variables for your dynamic inputs, you may encounter errors that prevent inputs from
    receiving the JSON values they need. When a dynamic input scripting error occurs, the following warning message may appear.Figure 1. Message displayed for scripting error ![Dynamic action error message]()

Limit dynamic inputs type inputs to 40 input values
:   A dynamic inputs type input can only render a certain number of inputs before the JSON object becomes to too big to store in memory. Limiting your dynamic inputs to 40 input values minimizes the chances that you will run
    out of memory and experience unexpected behaviors such as rendering errors or data truncation.

Limit JSON output to 5000 array items for dynamic templates and dynamic choices
:   Dynamic choice and dynamic template inputs can only display up to 5000 array items. A dynamic choice can only display up to 5000 choice list options, and a dynamic template can only display up to 5000 field template
    values. If your data gathering action collects data for a dynamic template or a dynamic choice, restrict the maximum number of array items it returns to 5000. The 5000 array items limit prevents the instance from having
    performance issues when rendering the choices or field values.
* **[Get started with dynamic inputs](https://www.servicenow.com/docs/OLM0VkZwCTb6TjmQu~~kjg#getting-started-dynamic-input)**   
  Create a sample action that illustrates using all available types of dynamic inputs in a flow.
* **[Create a data gathering action for a dynamic choice](https://www.servicenow.com/docs/cjIgPUIe6Udo_8vMGcSmQw)**   
  Create a data gathering action to generate a list of choice options for a dynamic choice input.
* **[Create a data gathering action for a dynamic template](https://www.servicenow.com/docs/nv69t~CqfBYBIIEJYQVZvw)**   
  Create a data gathering action to collect record field values for a dynamic template input.
* **[Create a data gathering action for a dynamic inputs type input](https://www.servicenow.com/docs/FK956UTV7saAtcow7zH_VQ)**   
  Create a data gathering action to create arbitrary action inputs using a dynamic inputs type input.
* **[Dynamic input configuration options](https://www.servicenow.com/docs/yaYj3xVPo_9B~J9It~qXqA)**   
  Use these options to configure dynamic inputs.

