StyloDocs
Workflow blocks

Function

Run custom JavaScript code within your workflow

View as Markdown

system/function — Run custom JavaScript code within your workflow.

Where it appears

The Function block lives in the Logic & control group of the Workflow Builder.

Fields

FieldTypeRequiredDefaultDescription
inputDatatext (multi-line, supports references)NoData to expose to your code as input.inputData. If you reference a single upstream object/array, it's passed through as-is; otherwise the JSON is parsed.
codecodeYesJavaScript executed at this step. Read the Input Data field via input.inputData and return a value, which becomes the block's result output for downstream steps.
timeouttextNo5000Maximum execution time. Values above 10000ms are clamped.

Inputs and outputs

Inputs are the configurable fields above. The block produces these outputs:

Outputs

Reference an output downstream with <Function.field>.

NameTypeDescription
resultjsonReturn value from the executed JavaScript function
stdoutstringConsole log output from function execution
successbooleanWhether function executed successfully
errorstringError message if execution failed

Example

A minimal configuration for this block:

{
  "type": "system/function",
  "config": {
    "code": "...",
    "timeout": "5000"
  }
}

Limits and failure modes

  • Required field (code) must be set, or the block fails validation before it runs.
  • On failure the error output is populated; downstream blocks that reference other outputs may not receive values.

On this page