Skip to content

MergeResults

The mergeResults module is an advanced version of Merge that supports nested iterations with hierarchical levels. It collects the results of each processed iteration, stores them in memory (not in the database), and when the last chunk is received, combines all results ordered by index. It supports unique merge keys per iteration level (mergeLevel) and group (mergeGroupKey), which allows correctly handling iterations within other iterations. Each result includes the status (ok/error), the processed record data, and the iteration path.

ParameterTypeRequiredDescription
(no configurable parameters)--This module does not require additional configuration. It operates automatically based on the _meta_ metadata from the data and the memory context.
{
"nextModule": "siguiente_modulo",
"data": {
"summary": [
{ "index": 0, "status": "ok", "record": { "resultado": "dato1" }, "iterationPath": "0" },
{ "index": 1, "status": "ok", "record": { "resultado": "dato2" }, "iterationPath": "1" },
{ "index": 2, "status": "error", "record": { "error": "mensaje" }, "iterationPath": "2" }
],
"_iterating": false,
"mergeInfo": {
"level": 0,
"groupKey": "uuid-iteracion",
"totalItems": 3
}
}
}
{
"label": "mergeResults Iterator"
}
  • Uses the context memory system (ctx.memory) instead of the database to store partial results.
  • Requires _meta_.workflowRunId and _meta_.totalChunks to function.
  • The memory key is constructed as: mergeResults_{workflowRunId}_{mergeGroupKey}_{mergeLevel}.
  • Supports nested iterations thanks to mergeLevel and mergeGroupKey in the metadata.
  • Results are sorted by index before the final output.
  • Memory is automatically cleaned up when the merge is complete.
  • If chunks are still missing, it returns nextModule: null with _iterating: true and current progress.
  • Each result includes status: "ok" or status: "error" depending on whether there were processing errors.
  • Iterator - splits an array into chunks
  • Merge - basic version of merge with database
  • MergeIterator - simplified merge for iterations
  • Repeater - generates repetitions that are later recombined