Node - Subflow
Use Case
For the same data sheet, the same business logic is triggered in different ways.
For example, for a reimbursement approval process, the approval process is triggered when a record is added, or it can be saved as a draft first, and then the approval process is triggered later by clicking a button. Although the triggering method is different, but the approval process (approved by whom) is the same, so you can take the started approval process as a subflow, a general process, whether it is triggered by adding a record or clicking a button, you can call the subflow directly and start the approval process.
When the data to be batch processed exceeds 100 items, select the subflow.
When there is too much data to be batch processed (more than 100), you can select a subflow, which can batch process up to 10,000 rows of data.
When batch processing data, you need to set different branches according to the content of the data.
When you get 50 pieces of data from external sources, some of them do not need to be added in the worksheet, and some of them already exist and only need to be updated. At this time, you can not directly use the [Update Node] to batch update, but you need to pass multiple pieces of data to the subflow, and find out if it exists in the subflow first, and then add or update it.
The data passed to the subflow can be a single record, multiple records or multiple rows of data (Wehook, arrays of code blocks, operation details for manual nodes).
Examples
Example 1: How a re-usable process can be used as a subflow
How to configure subflows for approval processes that are triggered when adding a new record, or when clicking a button?
When adding a new record triggers a workflow, simply configure the trigger node and then add a subflow node.
A: Select data recorded by which node object to be passed to the subflow.
B: Click the [Save] button to automatically generate a subflow.
C: If checked, subsequent nodes (send station notice) will be executed only after the subflow is executed; if unchecked, the subflow and subsequent nodes will be executed at the same time, and the execution result of the subflow will not have any effect on the current process.
Open the subflow
Configure the subflow
Configure the approval process in a subflow, and finally publish the process.
How to reuse already configured processes for workflows triggered by custom buttons?
After clicking the button to trigger the process, add a subflow node, and select an existing subflow.
Tips
When you select a subflow, you can only select a subflow but cannot select a process that is triggered by worksheet, by a date field, by a certain time, by Webhook, or by a custom button.
Subflows cannot be created independently, but can only be created and used in the main process.
Workflow Consumption: According to the example process configuration, the main process is executed once and the subflow is executed once , consuming a total of two times.
Example 2: Batch process large amounts of data
When the project status is updated to Completed, the tasks associated with the project are automatically marked as Completed.
When the obtained tasks are less than 100, they can be processed directly in the current process (add the [Update Record] node).
However, if the obtained tasks are more than 100 and less than 10,000, you need to add a subflow to update the status of the tasks in bulk. The configuration is as follows:
A: Choose data from which node will be passed to the subflow: here the [Get Multiple Data] node is chosen.
B: Since it is batch processing data, you may need to set the execution order.
Execution methods
- Parallel: If these records do not affect each other, just select Parallel.
- Plain sequence: Subsequent subflows are triggered only after the current subflow is executed; if a subflow is terminated, none of the subsequent subflows will be executed.
Subflow Configuration:
Processing Logic:
For example, the main process passes 500 records, and each record triggers a sub-process. If the Task Status field is updated for each record, the subflow is executed 500 times, a total of 501 times (1 main process and 500 subflows).
Have questions about this article? Send us feedback