Nected Docs
Try Nected For Free
  • 5 min QuickStart Guide
  • Getting Started
    • Introduction
    • Core Concepts
    • Use Cases
    • Tech Architecture
    • FAQs
  • INTEGRATIONS
    • Overview
    • Integrations Libraries
      • PostGres
      • MySQL
      • Oracle
      • MS SQL Server
      • Snowflake
      • MongoDB
      • RedShift
      • REST API
      • Google Sheets
      • Slack
    • Managing Integrations
  • DATASETS
    • Overview
    • Managing Dataset
  • Rules
    • Overview
    • Rule Types
      • SimpleRule
      • DecisionTable
      • Ruleset
      • Rule Chain
    • Rule Conditions
    • Rule Actions
    • Concepts
      • Rule Result
      • Test & Publish Rules
    • Add Input Attributes
      • JSON Input Attributes
      • List Input Attributes
  • Triggers
    • Trigger Rule via API
    • Trigger Rule via WebHook
    • Trigger Workflow via API
    • Trigger Workflow via WebHook
    • Scheduler
    • Rule Response Format
  • Workflow
    • Overview
    • Managing Workflow
    • Add Node
      • Action Nodes
        • Rule Node
        • Workflow Node
        • Custom Code Node
        • Database Node
        • REST API Node
      • Control Nodes
        • Loop Node
        • Delay Node
        • Response Node
        • Set Variables Node
        • Switch Block
    • Test & Publish Workflows
  • CODE AND DATABASE QUERIES
    • JavaScript Editor
    • Formula Editor
    • JSON Editor
    • List Editor
    • Excel-like Function
  • Embedded System
    • White-Labelling
    • Embeddable View
  • Self Hosting
    • Overview
    • Infrastructure Sizing
    • New Installation
      • Docker
      • Kubernetes
        • Set Up Kubernetes Cluster on AWS EKS
    • Additional Configuration
      • High Availability
      • Email Setup Guide
    • Upgrade Nected Version
  • Security
    • API Authentication
      • OAuth as part of Authentication under REST API
    • Role Based Access Control (RBAC)
    • SOC 2 Type 2, GDPR, ISO Compliance
  • Audit
    • Audit Trail
    • Approval Flow
    • Version Control & Rollback
    • Import/Export
  • Management API
    • Audit Log API
    • Global Variable API
  • References
    • Attribute Library
    • Global Variables
    • Pre-Configured Tokens
    • Pre-Configured Operators
    • NULL Value Handling/Behavior
    • Troubleshooting Errors
      • Multiple Tabs/Users Edits
      • Limits in Nected
    • Allowed Status Combinations
    • Environments
    • Usage Widget
    • Gen AI
  • ACCOUNT SETTINGS
    • Workspace Setting
      • Date Format and Timezone Settings
Powered by GitBook
On this page
  • Settings Tab
  • Timeout after:
  • Continue on error:
  1. Workflow
  2. Add Node
  3. Action Nodes

Custom Code Node

PreviousWorkflow NodeNextDatabase Node

Last updated 7 months ago

In the Code Node, users can execute custom javascript code within the workflow. This provides flexibility to perform complex computations, data manipulations, or integrate custom logic.

Adding and Configuring a Code Node

  1. Find the spot in your workflow where you need the custom code execution to occur.

  2. Choose the Code Node from the 'Add Node' panel and place it on the workflow canvas.

Configuration Tabs for Code Node

Input Params Tab

This is where you specify any input parameters your code needs.

  • Select Language:

    • Choose the scripting or programming language you will use. In the screenshot, JavaScript is selected, which is commonly supported in workflow tools.

  • Add Query/Code:

    • Write or paste your code in the provided code editor. You can incorporate workflow data using tokens, such as {{Trigger.item_no[0]}}, which would access data from the workflow trigger.

Test Results Tab

After coding, you can test the script to ensure it executes as expected within the workflow context.

  • Testing the Code:

    • Provide necessary inputs if your code requires them, and click the 'Test' button. This will execute the script within a controlled environment and return the results.

  • Interpreting the Output:

    • The output from the execution of your code will be displayed in JSON format, allowing you to validate the results of your script.

Settings Tab

Adjust the execution settings for your code within the workflow.

Timeout after:

The "Timeout after" option allows you to set a time limit for the node's operation. If the node takes longer than the specified time, it will automatically stop running.

Continue on error:

If you turn this setting on, then even if the workflow node gets any error, the workflow will continue to execute the next node with the error.

Let's take an example:

Let's say we have these 3 nodes in our workflow:

The first one is a Formula node, the second one is a Rule node and the third one is a database node.

What Happened Before

In the past, our workflow system was designed with a stringent error management approach. If any node within the workflow encountered an error at any point during its execution, the entire process would come to a complete halt. This meant that if the first node, for example, "modified_cart," experienced any error, the workflow would not proceed to the next node. Instead, it would stop immediately at the first node, requiring immediate intervention to address the error before the workflow could continue. This approach prioritized error verification and strict control over processes, but it also meant increased interruptions and potential delays as errors were resolved one at a time.

What Happens Now

Our current system introduces a feature called "Continue on error," which can be toggled on or off for each node in the workflow. When this setting is activated, it allows the workflow to proceed to the next node even if an error occurs in the current node. Specifically, if the first node, like "modified_cart," encounters an error while this setting is enabled, the workflow will not be halted. Instead, it will advance to the subsequent node, such as the rule node, with the error details passed along from the previous node. This functionality facilitates the continuation of the workflow despite errors, promoting greater flexibility and resilience in managing workflows by allowing for potential error handling at later stages of the process.