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
codecodeYesJavaScript executed at this step. Reference any upstream output directly with <Node.field> — it resolves to the actual value (objects and arrays are preserved). return a value, which becomes this 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