Skip to main content
工作流应用

Script Node

The Script Node enables custom code execution within a workflow. By writing JavaScript or Python code, it processes input data and returns results—ideal for data transformation, formatting, complex calculations, and business logic processing.

Adding the Node

Method 1: Add via the + Button

  • Hover over any node on the canvas (e.g., the Start Node); a + button automatically appears on its right side.
  • Click the + button, then select Logic Script from the pop-up node list. The node is automatically added to the canvas and connected to the upstream node.

Method 2: Drag from the Node Library

  • In the left-hand node library, locate and select Logic Script.
  • Drag the node onto the canvas at your desired location, then drag a connection line from the edge of an upstream node to this node.

Core Configuration

Inputs

Define the input variables the script node will process. Click Add Variable to add an input parameter. Each input parameter includes the following settings:
ParameterDescription
Variable NameThe name of the input variable, used to reference it in your code.
Reference ModeInput: Enter a static value directly; Reference: Reference an output variable from an upstream node.
ValueThe value of the input variable. When Input is selected, enter a static value directly; when Reference is selected, type / in the field to trigger variable auto-completion—supporting references to upstream node outputs.

Code

Write the core logic in either JavaScript or Python.
LanguageDescription
JavaScriptRuns on the V8 engine and supports ECMAScript 2022 syntax. Selected by default.
PythonSupports the Python standard library—well-suited for data processing and computation.

Retry on Failure

Disabled by default. When enabled, the node automatically retries upon timeout or runtime error. When disabled, failures result in immediate errors.
ParameterRangeDefaultDescription
Max Retry Count1–103Maximum number of retries on failure.
Retry Interval300–10,000 ms500Delay between retry attempts.

Error Handling

Disabled by default. When enabled, custom logic executes upon node failure.
Handling StrategyDescriptionDefault Value
Output predefined content on error. Requires configuring a default return value in valid JSON format.Error BranchOn error, the error branch executes. Selecting this option automatically creates an error branch—you must configure its downstream processing flow.

Node Outputs

The dictionary returned by the script’s return statement becomes the node’s output. Output variables must be manually defined in the configuration panel. Click Add Variable to define an output variable. Each output variable includes the following fields:
ParameterDescriptionVariable Name
Name of the output variable—must exactly match a key in the object returned by return.TypeData type of the output variable (e.g., Number, String, etc.).