Updated on 2023-12-28 GMT+08:00

Script

The script processing component is used to process data. You can use a specified programming language to compile a script, process the data transferred to the script processing component, and generate new data for subsequent steps.

Configuration Parameters

Parameter

Description

Script Language

Programming language used for writing scripts. Currently, only JavaScript of the ES5 version is supported.

Content

Compile the script content.

You can reference data from previous nodes. For details, see Referencing Variables.

To parse content data in JSON format, use JSON.parse('${body}') to convert the content data into a JSON object and then parse the data.

The script processing component can generate an output result and transfer it to subsequent nodes. You need to specify the name of the variable to be output at the end of the script. For example:

function getUser(){
    return {"id": ${property.id},"name":"${property.name}"};
}
var user=getUser();
user;
NOTE:

If you need to write a function or logic code block, use braces ({}) to surround the code block.