Copy Task
  • 31 Oct 2024
  • 7 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Copy Task

  • Dark
    Light
  • PDF

Article summary

Overview

The Copy Task node allows you to send a copy of a task to another Process. When you use the node, the task is essentially duplicated with one copy proceeding in the current Process and a new copy being passed to another Process. The two copies are independent of one another, but unlike the Call Process node, the Copy Task node does not wait for a response from the other Process.
Copy Task flow

Settings

The Copy Task node has the following parameters:

  1. (Optional) Title and Description: Name and details of the node.

  2. Basic settings:

    • Process to which you want to copy the task: You can select the needed Process by clicking the directory icon Directory icon or by specifying its Process ID or Alias.
    • (Optional) Reference of the task copy: An identifier for the copied task.
    • Copy all task parameters to the new task:
      • The checkbox is selected: All current task parameters will be sent along with any parameters specified in the node.
      • The checkbox is cleared: Only the parameters specified in the node will be sent.
  3. Parameters:

    • Key: Key to specify variables; use a unique name. When updating existing variables, use their original names as a key.
    • Value: The value you want to assign to the corresponding Key parameter. The value can be a constant, a variable reference, or a function applied to a variable.

    Note: For more information, go to Parameters and functions.

    • Type of data:
      • String (S)
      • Number (N)
      • Boolean (B)
      • Array (A)
      • Object (O)

    Note: For more information, go to Data types.

    • Code editor: Shows the JSON format of the entered key and value. You can write and include additional code, which will be executed when a task enters the node.
    • To add a key-value, click + Add “key-value” below the Key field.
    • To delete the key-value line, click the trash icon Delete icon on the right side of the key-value line. Queue_actions
  4. Other:

    • Alert if the number of tasks in the node queue reaches the following number: Helps monitor whether the number of tasks in the node exceeds the specified threshold. When selecting the checkbox, you have to enter the needed number of tasks in the field that appears below.
    • Maximum interval, for which the task stays in the node before being forwarded: The amount of time a task is allowed to be in the node can be set in seconds, minutes, hours, and days.
      Note: The checkbox has a minimum value of 30 seconds. You can set a shorter interval by using the Unixtime function.

    Copy Task settings

Examples

Duplicating a task and adding a new parameter to the task copy

Description: Below, you can see the example where the Copy Task node is used to duplicate a task from the Original Process to the Destination Process.

Precondition:

  1. Add the Copy Task node to your Original Process.
  2. In Basic settings of the Copy Task node details panel, add:
    1. The Destination Process you want to copy a task from.
    2. The my_reference reference.
  3. Select the Copy all task parameters to the new task checkbox.
  4. In Parameters, add:
    1. The Origin parameter.
    2. The Hey, I’m from Copy value.

Copy Task ex_1

Flow: After adding a task to the Original Process, you can see that the Copy Task node not only duplicates the original task parameters but also adds some new ones. These system parameters are automatically generated by the Copy Task node and help trace the relationship between the original and copied tasks:

  • copy_conv_id: Stores the ID of the Process (Original Process) from which the task was copied.
  • copy_node_id: Indicates the ID of the Copy Task node that created the copied task.
  • copy_ref_id: Stores the ID of the initial task from which the copy was created.

The task in the Original Process does not include the parameter that was defined within the Copy Task node but has the conveyor_copy_task_result parameter to keep track of whether the duplication was successful.
Copy Task ex_2

You can access a single task parameter or a whole task stored in a State Diagram by Getting Task Parameters from State Diagrams.

Error handling & troubleshooting

When an error occurs in the Copy Task node, a task goes to the auxiliary Condition output node that is used for storing error parameters.
image.png

When an error occurs during the task processing, you may see the following error parameter names in the task.

Error parameter nameError type
__conveyor_copy_task_return_type_error__Hardware (system error), Software (error in a node logic/settings).
__conveyor_copy_task_return_type_tag__*Error tag.
__conveyor_copy_task_return_type_description__Error description in human-readable language; can be static or dynamic.

*The error tag __conveyor_copy_task_return_type_tag__ may have the following values.

ValueCauseSolution
access_deniedYou don't have access to the Process you are trying to call.Contact the Process owner to get access.
access_deniedYou are trying to send or receive tasks from another stage.It's not allowed to get and send tasks between stages. Use the same stage to send and receive tasks.
access_refusedThe Process you are working on is not a State Diagram but it must be a State Diagram.Check the logic of using a State Diagram. For more information, go to State Diagram.
conveyor_is_not_activeThe target Process is not active.Make sure that the Process that you are trying to copy the task to is active.
crash_apiError occurred when sending the task to the Process with the Reply to Process node.Contact your administrator for further assistance.
no_api_callback_in_node_with_taskNo API callback logic found in the node with the task.Specify the ID or alias of the Waiting for Callback node or add this type of node.
copy_task_timeoutTimeout when performing task copying.Retry copying the task or contact your administrator for further assistance.
not_unical_refThe task reference is not unique.Check whether there is a task with the specified reference in the Process you are attempting to copy a task to.
wrong_validate_paramsParameter validation error.Check the types and values of the parameters you have specified in the Copy Task node.
copy_task_wrong_convert_paramParameter value failed to convert with the specified parameter type.Check and correct the data type of the parameter mentioned in the error message.
not_found_conv_by_aliasYour alias is linked to a Process that no longer exists.Use an existing Process.
copy_task_size_overflow_limitThe size of the task you are trying to copy exceeds the specified limit set for your environment.Reduce the size of your task by modifying the data or splitting it into several smaller tasks.
duplicate_callbackYou are sending the next task with the same reference while the first one is still in the Callback node.Wait until the first task leaves the Callback node.
conv_not_found_or_deletedYou are trying to work with a non-existent Process.Use an existing Process.
bad_utf8_stringThe key or value you are using is not valid.Check whether the key and value have the utf8 symbols.
copy_task_eq_convsYou are trying to copy your task to itself.Choose another task to copy or as a target to copy yours in.
ref_is_not_string_formatThe task reference specified in the parameters of the copied Process is incorrect.Check whether the reference belongs to the String type of data.
limit_delayed_tasks_to_this_user_is_overflowThere is a specified limit for the user to set the time intervals (long or short) in the Delay nodeContact your administrator for further assistance.
bad_callback_nodeThe Process you are calling doesn't have the Callback node.Create the Callback node in the Process you are calling.
not_found_taskNo task with the specified reference exists in the Process.Make sure you entered the task reference and Process correctly. Note: An empty reference is not considered unique: if only a single task with an empty reference exists, you cannot access it by reference.
not_found_main_nodeThe Start node is missing in the Process in which you are trying to copy a task.Check whether the Start node exists in the Process you are copying to your task.
copy_task_fatal_errorThe Copy Task node error.Check the Process to which you are trying to copy the task or contact your administrator for further assistance.

When working with your Process or State Diagram, you may encounter the following issues.

IssueCauseSolution
The specified task can't be modified.The destination Process already has a task with the same reference.Make sure to specify a unique task reference for each task within a Process.
The task you are trying to send to a Process does not have the input parameters required by the destination Process.Make sure to include all the required parameters or modify the list of those.

Was this article helpful?

What's Next