JSON

Provide JSON formatted data to your Flow directly from the user or from a file.

The JSON component allows you to store user supplied JSON data and feed it into a Flow, or alternatively, the JSON data can be loaded from a user specified data file. Data can be cached for maximum performance.

The JSON component value (user entered text) has the identifier of json-X, where X represents the instance number of the JSON component.

The JSON component has the following parameters that can be specified directly on the UI component.

Parameter NameDescription

Method

This parameter specifies whether to source Python code from a file that you supply or alternatively you can enter the Python code directly in the UI component editor. Available values: - Manual Script - JSON File

The JSON component has the following input connections.

Input NameDescriptionConstraints

From Python

This input connection represents the input text to the Python component.

Must come from any component that generates a text string.

Component Outputs

The JSON component has the following output connections.

Output Name FormatDescriptionConstraints

json-1

This output connection contains the textual content of the JSON.

This must be connected to either an LLM or a Python block.

The JSON component has the following configuration options.

Configuration Option NameDescription

Description

This is a user supplied textual description of JSON component.

Enable Caching

This option determines whether the results of the component are cached. This means that on the next run of the Flow, Diaflow will utilize the previous computed component output, as long as the inputs have not changed.

Caching Time

Only applicable if the "Enable Caching" option has been enabled. This parameter controls how long Diaflow will wait before automatically clearing the cache.

Clear Cache

Only applicable if the "Enable Caching" option has been enabled. Clicking this button will clear the cache.

Use Cases

The following is a simple use case of the JSON component, where the JSON component is being used to provide JSON data to a Python component.

Last updated