Operations (sample payloads)

Main operations

Execute Asynchronous Script

Execute a block of JavaScript code asynchronously. Sample Input

{
    "variables": [
        \{
            "name": "firstName",
            "value": "John"
        \},
        \{
            "name": "lastName",
            "value": "Doe"
        \},
        \{
            "name": "age",
            "value": 30
        \}
    ],
    "script_async": "exports.step = function(input, fileInput) {\n  const fullName = input.firstName + ' ' + input.lastName;\n  return \{\n    fullName: fullName,\n    age: input.age,\n    isAdult: input.age >= 18\n  \};\n};",
    "files": [],
    "file_output": false
}

Sample Output

{
    "result": \{
        "fullName": "John Doe",
        "age": 30,
        "isAdult": true
    \}
}

Execute Script

Execute a block of JavaScript code. Sample Input

{
    "variables": [
        \{
            "name": "firstName",
            "value": "John"
        \},
        \{
            "name": "lastName",
            "value": "Doe"
        \},
        \{
            "name": "age",
            "value": 30
        \}
    ],
    "script": "exports.step = function(input, fileInput) {\n  const fullName = input.firstName + ' ' + input.lastName;\n  return \{\n    fullName: fullName,\n    age: input.age,\n    isAdult: input.age >= 18\n  \};\n};",
    "files": [],
    "file_output": false
}

Sample Output

{
    "result": \{
        "fullName": "John Doe",
        "age": 30,
        "isAdult": true
    \}
}

Was this page helpful?