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 ﬂow.
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:
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.
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.
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.
The options below let you define how you want the data to be returned from the Synchronous Flow.
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
voidin 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
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.
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.
This option is deprecated and is now set by the return type. See above.
Select the Gear icon at the top-right of the window to show the advanced options available:
Enter the number of concurrent calls you require the flow to execute concurrently.
Select the method you want the flow to use when processing records.
Series - Process the records one by one.
Parallel - Process the records simultaneously.
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.
Read about other Flow steps.
Revisit the Getting Started page for a refresher.
Read more about Steps here.