Call a Process
  • 19 Feb 2024
  • 5 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Call a Process

  • Dark
    Light
  • PDF

Article Summary

Overview

The Call a Process node offers a powerful means to simplify and optimize your workflows, making them more readable and maintainable. You can achieve enhanced efficiency by seamlessly integrating the logic and functionality of other Processes into your current one. By selecting the desired Process from the directory or specifying its ID, you can send a task to that Process and receive the result back to the Call a Process node.

The Call a Process node has the following benefits:

  • Break down complex Processes into smaller ones
  • Promote reusability by eliminating redundancy and duplication
  • Isolate Processes to prevent impact on others

To ensure smooth operation of the Call a Process node, include the Reply to Process node in the called Process. Without it, tasks can stall in the Call a Process node, hindering result retrieval. This can be compared to a programming function without a return statement.

Call a Process.png

Avoid recursion by using Call a Process. Although it is technically possible to use the Reply to Process node within the same Process, we advise against it, but instead, it is better to use the Copy Task node.

Documentation Diagrams 1.png

Settings

The Call a Process node has the following parameters:

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

  2. Basic settings:

    • Process to call: You can select the needed Process by clicking the directory icon Directory icon or by specifying its Process ID.

    • Send all parameters:

      • 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.
    • 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.
      • Type of data:
        • String (S)
        • Number (N)
        • Boolean (B)
        • Array (A)
        • Object (O)
      • 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
  3. 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.

    Call Process settings

Examples

Basic usage of the Call a Process node
Description: Below, you can see the example where the Call a Process node is used to send a task from the Call Process to the Reply Process that sends back a reply.

Precondition:

  1. Add the Call a Process node to your Call Process.

  2. In Basic settings of the Call a Process node details panel, add:

    • The Reply Process you want to call.
    • The call_param parameter.
    • The I was added in Call value.
  3. Clear the Send all parameters checkbox

    Parameters can be sent when:

    • The Send all parameters checkbox is selected + no parameters: All parameters that are part of the original task are sent.
    • The Send all parameters checkbox is cleared + parameters: Only the specified parameters are sent. You can either create new parameters or send parameters that are part of the original task.
    • The Send all parameters checkbox is selected + parameters: The specified parameters are added to the original task parameters. If you specify a parameter with the same name as one of the task parameters, only the specified parameter will be sent.
    • The Send all parameters checkbox is cleared + no parameters: The option is not permitted; at least one parameter must be sent.
  4. Add the Reply to Process node to the Reply Process you are going to call.

  5. In Basic settings of the Reply to Process node details panel:

    1. Add the reply_param parameter.
    2. Add the I was added in Reply value.
    3. Clear the Send all parameters checkbox.

Call Proc ex_1

Flow: Add a task with the original_task parameter and the I’m from the original task value to the Call Process. Once the task reaches the Call a Process node, it gets stuck in the node, a new task with the call_param and system parameters is created and sent to the Reply Process. After the new task enters the Reply to Process node of the Reply Process, a new task with the reply_param parameter is generated and sent back to the Call a Process node while the task that entered the node continues to move downstream. Once the task from the Reply to Process node is received in the Call a Process node, its parameters are merged with the original task parameters and added to the original_task and reply_param parameters.

Call Proc 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 Call a Process 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_rpc_return_type_error__Hardware (system error), Software (error in a node logic/settings.)
__conveyor_rpc_return_type_tag__*Error tag.
__conveyor_rpc_return_type_description__Error description in human-readable language; can be static or dynamic.

*The error tag __conveyor_rpc_return_type_tag__ may have the following values.

ValueCauseSolution
access_deniedYou do not have permission to access the Process you are trying to call.Normally, the UI doesn’t allow you to select a Process you do not have access to, but you can circumvent it by passing the Process ID as a variable. Make sure you have access to the Process you are calling.
wrong_validate_paramsThe called Process was configured to receive specific parameter types (String, Number, Object, and so on), but at least one parameter passed from the Call a Process node doesn't match the one that was specified.Make sure that parameter types match the parameter values that you have specified in the Call a Process node.
rpc_task_wrong_convert_paramParameter type specified in the Сall a Process node does not match the actual value.The parameter type specified in the Сall a Process node does not match the actual value.

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

IssueCauseSolution
Task is stuck in the Call a Process node.The task inside the called Process has not reached the Reply to Process node.Make sure that the called Process has the Reply to Process node and it is accessible.

Was this article helpful?