Skip to content

Manage Input and Output

Agent flows in GALE allow you to define input and output variables, which become accessible as context objects throughout the execution of the flow.

  • Input Variables: The input variables provide initial data to the agent flow.
  • Output Variables: The output variables store and make accessible the derived values from the flow. You must define output variables to capture the results you want to return from the agent.

Using Variables in the Agent Flow

Once the input and output variables are defined, you can access these variables using the context object syntax and use them throughout the flow:

  • Input variables are available immediately after the Start node. These variables can be accessed using the following syntax: context.steps.Start.inputVariable
  • Output variables can be set in any node. For example, in the End node, you can select a defined output variable and assign it the result/output of a GenAI node using the following syntax: {{context.steps.GenAInode.output}}

Adding Input/Output Variables

Steps to add input variables:

  1. On the top of the Agents flow canvas, click the Manage I/O button. Alternatively, you can click the Start node. The Manage Input & Output dialog is displayed.
    Manage Input Output Variables

  2. On the Input tab, click the + Add input variable button.

    The Enter input variable dialog is displayed.

    Enter Input Variable

  3. In the Name (key) field, provide a name for the input variable. For example, Product_ID.

  4. In the Type field, select a data type from the drop-down list - Text, Number, Boolean, JSON or Remote file. If you want to make the data type mandatory, then enable the Mandatory toggle.

  • If you select the Text, Number, or Boolean data types, the Default value field appears. You can enable the Default value field to set a default value for the input variable.
  • If you select the JSON data type and enable Default Value, a code editor appears. You can define a JSON schema or format for the input parameter. This option allows you to set a default value for the specified field, and validate it against the designated data type. If the JSON is invalid, the system will display the relevant error message and execution will fail. json Input Variable
  • If you select the List of values (Enum) data type, you can set predefined values that are allowed for agent input variables by clicking Add Values +. Enter Input Variable window
  • When you enable Default value, the defined values get listed in the dropdown for selection. add default key value
  • The system validates the input against the defined enum values and provides an error message if an invalid value is provided.
  • If you select the Remote file data type, the File url timeout field appears. Enter the File URL timeout duration in minutes. The default File URL timeout is 5 minutes. You can set it to anywhere between 5 minutes and 7 days (10080 minutes).
  • File URL timeout
  1. Click Save. The input variable is displayed on the Input tab of the Manage Input & Output dialog.

Steps to add output variables:

  1. On the top of the canvas of the Agents page, click the Manage I/O button. The Manage Input & Output dialog is displayed.

  2. On the Output tab, click the + Add output variable button. The Enter output variable dialog is displayed.

Enter Output Variable

  1. In the Name (key) field, provide a name for the output variable.

  2. In the Type field, select a data type from the drop-down list - String, Number, JSON or Boolean. This allows you to generate data in the defined type as the output parameter from an agent/tool, making it compatible with downstream systems.

Note

  • The Import button is enabled when the required information is provided.
  • GenAI node models and guardrail configurations may not be available in the current account. Reconfigure them before running the agent.
  • If a type mismatch occurs, the endpoint still succeeds but includes a warning in the response along with the key name and the nature of the mismatch.
  • If one or more keys fail validation, the response includes warnings for the failed keys and outputs for the valid ones.

  1. Click Save.
  2. The output variable is displayed on the Output tab of the Manage Input & Output dialog.

Note

You can also add an output variable in the End node using the Add a Key option on the node's interface.