Workflow blocks
Function
Run custom JavaScript code within your workflow
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
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
inputData | text (multi-line, supports references) | No | — | Data 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. |
code | code | Yes | — | JavaScript 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. |
timeout | text | No | 5000 | Maximum 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>.
| Name | Type | Description |
|---|---|---|
result | json | Return value from the executed JavaScript function |
stdout | string | Console log output from function execution |
success | boolean | Whether function executed successfully |
error | string | Error 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
erroroutput is populated; downstream blocks that reference other outputs may not receive values.