Task Manager


The Task Manager node converts its input into one or multiple task objects and relays the object or objects to the downstream nodes. It then monitors whether the downstream nodes have processed the task object or objects as those nodes are designed to do. The result of the execution of each object will be recorded by the Task Manager node, which can then re-relay the failed objects to downstream nodes for re-execution as configured.


If any of the downstream node fails to process any of the task object as the node is designed to do, the task of processing this object is marked as Failed by the Task Manager node. Only when all downstream nodes succeed in processing all the task objects can the task be marked as Successful.

Node Type

System.

Input and Output Ability

This node can take 1 input and 1 output. The input can be one of the following:

  • String
  • Array
  • JSON array


The output is one or multiple JSON objects that are split from the original input.


Every task object is identified by its unique task ID, which is stored in the metadata of the output and can be referred to by the expression ${metadata.taskId}.

Node Properties

../../_images/task_manager.png


Name

The name for this node.


Task Type

The number of task objects the Task Manager node splits the input into. The values are as per the below.

  • Single Task: The Task Manager node treats the input in its entirety, passing the entire input to downstream nodes and tracking its execution result.

  • Multiple Tasks: The Task Manager splits the input into multiple task objects, passes them to downstream nodes and tracks their execution results respectively.

    • Task List

      A required field if Multiple Tasks is selected above.

      The list of task objects that the Task Manager node splits the original input into. Use expressions like ${msg.key} or ${metadata.key} to specify which part of the input will be split as a separate task object from the input.


Policy

The way the Task Manager node deals with task objects that failed to be executed on any of the downstream nodes. If the switch is toggled on, the Task Manager node will re-send the failed task objects downstream so that the failed ones can be processed again by all the downstream nodes until all the objects are successfully processed or the number of retry attempts reaches Max Retry Attempts.


Max Retry Attempts

Used together with Policy. If Retry failed tasks is toggled on, the Task Manager node will re-send the failed task objects downstream so that the failed ones can be processed again by all the downstream nodes until all the objects are successfully processed or the number of retry attempts reaches Max Retry Attempts.


The maximum number of retry attempts is 5. If not specified, there will not be any retry attempts.


Description

The description for the node.

Limitations

  • Maximum number of retry attempts: 5

Samples

Input Sample

The following is a sample JSON array as input:

[
    {
        "assetId":"abc",
        "timestamp":24214324324,
        "measurepoints":{
            "temperature":22.4,
            "humidity":78
        }
    },
    {
        "externalId":"externalId",
        "timestamp":24214324324,
        "measurepoints":{
            "speed":32,
            "heat":40
        },
        "assetId":"assetId"
    }
]

Output Sample

Given that the input is a JSON array, the output is multiple JSON objects split from the input:

{
    "assetId":"abc",
    "timestamp":24214324324,
    "measurepoints":{
        "temperature":22.4,
        "humidity":78
    }
}
{
    "externalId":"externalId",
    "timestamp":24214324324,
    "measurepoints":{
        "speed":32,
        "heat":40
    },
    "assetId":"assetId"
}