Skip to content

Set the input properties of a block

Need to set input properties

As explained in the article describing workflow input and single block input, the input JSON that a workflow block receives when the workflow is executed depends on several factors:

  • The type of component of the block, which determines the existence of any input variables typical of the component.
  • In the case of a script interpreter block, JavaScript or Python, any explicit definition of input variables.
  • The position of the block in the flow and any description of the workflow input JSON.
  • Setting the block's input properties.

This article describes the generalities of this last activity, referring, for the peculiarities of the blocks of the various components, to the reference sections of this manual where the components are described in detail.

Setting the input properties of a block means explaining to NL Flow how a block must be fed at execution time, that is what the JSON input it receives must consist of. This in turn means mapping the block's input variables to top-level keys of what is expected to be the output—the "declared" output, from the manifest—of blocks upstream in the flow or, if defined, of the virtual block $nlflow_input.

Not all blocks have input variables and therefore not all blocks need input properties set. For example, operators like Fork or Tunnel are transparent to the input: they output what they receive. Even blocks with input variables, if they are the first in a flow and the workflow input has not been formally described, have an implicit configuration of the input properties: at execution time they automatically "look" in the input JSON passed to the workflow for top-level keys of the same type and with the same name as its input variables.

Procedure

When you add a block to the workflow, it is isolated and constitutes a flow in itself.
In this situation, any input properties should only be set if the workflow input has been explicitly described. In this case, proceed manually as explained below.

If the block is subsequently linked to an upstream block, the editor tries to automatically set the input properties using automatic mapping.
If it succeeds, it signals this with a message in the editor assistant.

If it fails, it signals the need to configure the input properties, again with a message in the editor assistant.

In this case, proceed as follows:

  • Select the pencil icon in the editor assistant message. The block properties' dialog open, focused on the section where you can set the input properties.

Or:

  • Edit the block and find the section of the dialog that concerns the input properties.

From this point on, the procedure for setting the input properties varies from component to component and is explained in the article that describes the component.
Search for the component you are interested in in the reference section of this manual. You can use the index of the manual to get to the article on the component or use the links below that take you to the overview of the component families:

In the overview then follow the link that takes you to the article on the component, look for the part that concerns the block properties and, among these, the input properties. You will find an explanation of how to set them manually.

For models, this link:

takes you directly to the part of the article that deals with input properties.

Also any custom components may have similar needs for setting input properties and similar procedures to do so. Refer to the documentation of the component.

Typically, input properties are set by mapping one or more input variables by choosing from a drop-down list that shows all the possible top-level output keys of the upstream blocks or, if defined, of the $nlflow_input virtual block.

Before mapping by hand, based on the component, you can try semi-automatic mapping with the assistant.
Select Map properties automatically on the right in the tabs' strip.

The drop-down list is divided in groups, one group for each upstream block. Select the expand and collapse icons to the right of the block name to show or hide the sub-list of output keys for that block.

Note

The drop-down list shows all the first-level keys that can, potentially, be available, but the keys that are actually there when executing the workflow may be less.

If an input variable of the block is of type object, there is also the possibility to choose the names of the upstream blocks from the list. By doing so, the entire JSON object produced by the upstream block will be mapped to the input variable.

You can filter the list by typing at the top of it: the list will show only keys with matching names.

To cancel the selection of the key, select No mapping from the list or, if you already chose a key, select Clear .