The Merge task’s "groupBy": "Task Instance" configuration operates similarly to grouping by "Task" with one distinction: it creates a separate merge array for each instance of the specified task.
Merge Condition Format
To apply this configuration, the merge condition must include at least the following two keys:
JSON
{
"groupBy": "Task Instance",
"taskName": "<Display name of a task node>"
}
Core Concepts
Example 1 - Group By Task Instance Basics
OBJECTIVE – Understand the relationship between the number of executions of the specified task in the merge condition and the quantity of merge results produced.
The Raw Data tab, containing the merge results, renders only for execution instances that match the task name specified in the merge condition.
There is a 1:1 correspondence between the number of executions of the specified task and the number of merge results.
Tasks A, B, and C each execute only once. Consequently, selecting any of them in a groupBy Task Instance situation produces a single merge instance containing the merge result.
Task D executes three times. Consequently, selecting it in a groupBy Task Instance situation results in three merge execution instances each containing an execution lineage object.
Had step 9 been executed using the merge condition grouping by Task rather than by Task Instance, the outcome would have been a single Merge instance containing the merge result. GROUP BY TASKMERGE RESULT
Example 2 - Merging Using a Task with Upstream and Downstream Nodes
OBJECTIVE – Understand how the Merge task processes execution lineage permutations with a designated task, considering its upstream and downstream nodes.
Build the following playbook:
Configure the JSON Data parameter of the Unwind A node as follows:
Configuring the merge condition with groupBy Task instead of Task Instance will result in a single Merge execution containing one consolidated array of the same twelve objects.
TAKEAWAY
Merge results will be distributed across instances, instead of being chunked altogether in one Merge execution instance.