The concept of reusability and reuse is well established in software engineering. Keeping component functions tight and well-defined also helps understanding and makes testing easier.

Within any specific flow that you create, there may be a need to reuse another flow synchronously, just as you would call a programming language function.

In traditional programming, there are concepts of functions, objects, and procedures that fulfill this purpose. In SQL, there are stored procedures that can be created for reuse. The common thread here is that logic elements can be grouped and called from multiple other places.

In Synatic, the Synchronous flow step fulfills this function. It lets you call a flow from within another flow. This step also lets you create common reusable flows to make building integrations even faster.


Using the Synchronous Flow step

The Synchronous Flow step waits for the called flow to finish processing and then, depending on the configuration settings, will insert the results of the called flow into the calling flow.

The Synchronous Flow step is located in the Destination drawer in the Steps palette.

  • Click the Show Steps text button above the flow canvas to display the Steps palette.

  • Type Sync in the search box or scroll down to find the Synchronous Flow step, then select and drag it to the required location in the flow.


Configuring the Synchronous Flow

Each Synchronous Flow step has several settings you can configure to control its operation. When you insert the step, the following dialog box is displayed to edit the relevant control values.

Below are descriptions for each of the setting options:

Flow ID

The Flow ID is the name of the flow that you want to call. You can choose a flow from the dropdown selection list within the same solution or from the list of global solutions.

Parameter Mappings

From Path

To Parameter

record.toaddr

toMail

You can map values to the input parameters of the sub-flow.

  • From Path is the path to the source value within the calling flow. You can use any value on the processing object.

  • To Parameter is the name of the input parameter on the flow being called.

Condition Path (Optional)

The path to a value on the processing object that the step can check to decide whether the Flow should be executed for the current record. A true value will execute the sub-flow, and a false value will skip the sub-flow.

Source Path

The path to a value on the processing object that will be passed to the sub-flow as its data source.

Note: If the sub-flow already has a source step defined, it will be used, and this parameter will be ignored.

Returns

The options below let you define how you want the data to be returned from the Synchronous Flow.

Return Type

Select the option type you want the Synchronous Flow value to be returned as one of the following:

  • None - No return. This is equivalent to void in traditional programming

  • Current - The default of the sub-flow being called

  • Array - Converts the output to an array

  • Object - Converts the output to an object

  • String - Converts the output to a string

  • Binary - Converts the output to a binary representation

Return Source

Selects what value types to return from the flow you are calling.

  • Auto - Auto detects the appropriate output

  • Record - Returns the current record processed by the sub flow.

  • Output - Returns the output of the Writer Step (if any) in the sub flow.

  • Result - Returns the output of the Destination Step (if any) in the sub flow.

Add to Record As

Adds the return to the current record in the parent flow as the field specified.


Options

These options are checkbox selections that are set off by default. Click to select the option you want to use during the flows run.

Ignore Run Error

Select this option to allow the flow run to ignore any errors that may occur in the sub flow. The parent flow will continue with the next record.

As Object

This option is deprecated and is now set by the return type. See above.


Advanced mode

Select the Gear icon at the top-right of the window to show the advanced options available:

Concurrent Calls

Enter the number of concurrent calls you require the flow to execute concurrently.

Concurrent Method

Select the method you want the flow to use when processing records.

  • Series - Process the records one by one.

  • Parallel - Process the records simultaneously.


Examples

For this example, you would use the Synchronous Flow step to call a secondary flow, configured to send a data file to an email address.

  • Let's say that the current flow you are working on gathers data from various sources and then aggregates it into a single data file.

  • The Synchronous Flow step, as shown in the video above, calls the Flow to send Email flow shown below, which sends the data file to the configured email address.

Now, if you wanted to submit this data file to other destinations, you can try creating other flows and send the data file to places, such as Google Drive or an HTTP service.


See Also

Read about other Flow steps.


Useful Tutorials

Revisit the Getting Started page for a refresher.

Read more about Flow Steps here.

Did this answer your question?