PingOne DaVinci

Best practices for data sharing

Follow these best practices when passing data between a flow and a subflow.

Passing data to a subflow

Add an input schema to the subflow to pass information from the parent flow to the subflow.

To see the input schema for the subflow, open the subflow, then click Input Schema in the upper-right corner of the flow canvas. You can add any number of required or optional properties to the subflow’s input schema.

We recommend using a consistent format, such as camel case, for naming input schema variables. For example, userName, emailAddress, and so on.

If the input variable is required for the execution of the flow, mark it as Required. Alternatively, you can select Require all defined parameters to require all parameters.

In the subflow, you can reference the input schema parameters as {{global.parameters.paramName}}, where paramName is the name used in the input schema.

In the parent flow, the Flow Conductor node that launches the subflow includes fields for each parameter in the input schema. Map values from the parent flow to each of the subflow’s input schema parameters.

Returning data from a subflow

Add an output schema to the subflow to pass information back to the parent flow.

When you configure the Send Success JSON Response and Send Error JSON Response nodes at the end of the subflow, you can include one or more fields in the response. By adding these fields to the subflow’s exit schema, you make them available in the parent flow after the subflow completes.

Click ⋮ > Output Schema to open the output schema, then add one or more parameters to the output code block.

In the parent flow, you can reference parameters included in the output schema using the structure {{local.nodeId.payload.output.property}}, where nodeId is the node ID of the Flow Conductor node that launched the subflow and property is the property name. You can also find these parameters in the {} menu.