The Zuper Workflow Builder provides a robust set of nodes to create flexible and automated workflows for managing business processes. This article outlines the available nodes, their descriptions, input/output details, use cases, error handling behaviors, and practical examples to help users effectively utilize the Workflow Builder.
Description:
The Edit Record node enables users to modify existing records within various Zuper modules, such as updating job statuses, assigning users, or modifying job schedules.You can also edit various records.Input/Output Details:
Input:Record ID: The Reference Method (referencing a previous node in the workflow, e.g., Get Job) or the Expression Method can be mapped. Configuration parameters depend on the selected action.
Output: Updated record details, accessible to subsequent nodes.
Use Cases:
Update the status of a job when it progresses to a new stage.
Modify job schedules dynamically based on customer requests.
Add service tasks to jobs for additional work requirements.
Error Handling Behavior:
Fails if the record ID is invalid or inaccessible.
Logs specific error messages for troubleshooting.
Example:
A workflow triggers when a job is created. The Edit Record node is configured to:
Action: Update Job Status.
Input: Taking the case of Job, reference the job ID from a “Get Job” node and set the status to “In Progress.” Alternatively, we can choose the trigger node from a dropdown menu. Modules with a trigger node, get record node, or edit record node can be conveniently selected from the dropdown.Output: The job status is updated, and subsequent nodes can use the updated job data.Node NameA unique identifier for the node in the workflow. Use a descriptive name (e.g., “Assign Parent Job”) to easily identify the node’s purpose easily.Node DescriptionA brief explanation of the node’s function, such as “Assigns a parent job to the current job,” helps users understand its role in the workflow.Pick a ModuleSelect the module this node belongs to, such as “Job” for job-related operations. Modules group related functionalities together.Select Related Job Node for UpdateChoose a job node in the workflow that this node will update. For example, selecting “Parent Job” links the current node to a parent job for modification.Module UIDA unique identifier for the module, such as “3456”. This UID ensures the system correctly references the selected module.Operation TypeDefines the action the node performs, such as “Update”. Other types might include “Create” or “Delete”, depending on the module.Assign UserSpecify the user responsible for the action. For example, “Assign User” can assign a job to a specific team member.Select TeamChoose the team responsible for the task, such as “Beta Team”. This assigns the node’s action to all members of the selected team.You have a list of modules where you can do multiple node actions:Coming soon
Description:
The Copy Custom Fields node copies field values from one Zuper module to another, enabling data synchronization between modules.Input/Output Details:
Input:
Source module and record ID (mapped via Reference or Expression Method).
Destination module and record ID.
Field mapping strategy: Manual (map fields one by one) or Automatic (copy fields with exact name matches).
Output: The destination module’s updated record with copied field values.
Use Cases:
Copy customer contact details from a Customer module to a Job module.
Sync custom field data between related records for reporting purposes.
Error Handling Behavior:
Fails if source or destination record IDs are invalid.
Example:
A workflow copies customer details to a new job:
Input: Source = Customer module (Reference Method, customer ID from a previous node); Destination = Job module; Field Mapping = Automatic (copy “Customer Name” and “Phone Number”).
Output: The job record is updated with the customer’s name and phone number.
Description:
The IF/Else node creates branching logic in workflows based on conditions, allowing different paths for true or false outcomes.Input/Output Details:
Input:
Conditions are defined using the expression picker to compare values from previous nodes.
Logical operators (AND/OR) for multiple conditions.
Connections to “true” and “false” paths.
Output: The workflow follows the “true” or “false” path based on condition evaluation.
Use Cases:
Route a job to a senior technician if the job priority is “High.”
Skip the notification steps if a job has already been completed.
Error Handling Behavior:
Fails if conditions are improperly configured (e.g., invalid expressions).
Example:
A workflow checks if a job’s priority is “High”:
This guide explains how to work with variables and expressions in the Workflow Builder’s code node, ensuring your JavaScript code runs smoothly and returns the expected output.Variable AccessTo use a variable in a code node, reference it using the VARIABLE object followed by the variable name. This allows you to access data defined elsewhere in your workflow.Syntax:VARIABLE.<variable_name>Example:
If you have a variable named zuperkey, you can access its value like this:let variable_value = VARIABLE.zuperkey;This retrieves the value of zuperkey for use in your code.Expression AccessTo reference outputs or expressions from previous nodes in your workflow, use the expression picker. Simply type I am running a few minutes late; my previous meeting is running over. in the code editor to open the picker, then select the desired expression or output.Steps:
Type I am running a few minutes late; my previous meeting is running over. in the code node.
Choose the expression or output from the list that appears.
The selected expression will be inserted into your code.
This feature ensures you can easily pull in data from earlier steps in your workflow.ConfigurationWhen writing code in the Workflow Builder’s code node, follow these guidelines:
Write JavaScript code: Use standard JavaScript syntax in the code editor.
Reference variables and expressions: Use VARIABLE.<variable_name> for variables and the expression picker (\) for prior node outputs.
Include a return statement: Every code node must include a return statement to:
Pass data to the next node in the workflow.
Display results if the code node is the final step.
Example Code:let userInput = VARIABLE.zuperkey; // Access variablelet result = userInput.toUpperCase(); // Process the variablereturn result; // Return the result for the next node or outputExpected OutcomeWhen configured correctly:
The code node will execute your JavaScript code.
The return statement determines the output, which is either passed to the next node or displayed as the final result.
Tip: Always test your code to ensure variables and expressions are correctly referenced and the return statement provides the expected output.
Description:
The Stop and Error node halts workflow execution and marks it as failed. It is typically used in error-handling branches.Input/Output Details:
Input: Optional error message or reason.
Output: None (workflow terminates).
Use Cases:
Stop a workflow if an API call fails.
Mark a workflow as failed if critical conditions are not met.
Error Handling Behavior:
Always marks the workflow as failed.
Example:
A workflow stops if a job cannot be assigned:
Input: Error Message = “No available technicians.”
Output: Workflow terminates, and the error message is logged.
Description:
The Wait node pauses workflow execution for a specified duration or until a specific date/time, capturing updates to mapped date fields.Input/Output Details:
Input: Wait duration or specific date/time; option only to capture Zuper field updates.
Output: Updated field values (if configured) and continuation to the next node.
Use Cases:
Pause a workflow until a scheduled job start time.
Error Handling Behavior:
Fails if the wait duration is invalid (e.g., negative duration).
Logs errors like “Invalid value of Date and Time.”