The Code node runs a custom script inside a sandbox when the built-in nodes don't cover what you need — a tricky transformation, a custom calculation, or a complex parsing step. It's an escape hatch: use it only for the part of your automation that genuinely requires custom code, and keep the rest in standard nodes. This page is a short overview; see Code by UnifyApps for the full list of actions.
Overview
Code supports several languages: Python, JavaScript, Groovy, Java, C#, Bash (through Execute Code (Sandbox)), and Playwright (for browser automation — covered on the Browser Automation page). The node runs your script in an isolated environment, hands the result back to the next step as a data pill, and keeps no state between runs. Besides the per-language actions, the node also has Execute custom code snippets (run a pre-written, reusable snippet instead of writing code inline), Execute method from classpath (invoke a method already deployed on the platform's Java classpath, for reusing existing enterprise Java logic), Execute Python function (call a Python function already deployed as an endpoint, rather than running inline script code), and Execute Code (Sandbox) (run Python or Bash code in a secure sandbox with input files, skill files, and output files).
Inputs and Outputs
You declare the inputs the script needs — each becomes a variable available inside your script by name, including nested inputs. The script returns a result matching the output schema you declare, which downstream steps read as data pills. For scripts that produce files, the result also carries the output files the script generated.
Common fields
Field | Required? | What it's for |
|---|---|---|
Code | Required | The script body, in the selected language. |
Inputs | Optional | The variables your script reads, defined by name and type; each becomes available inside the script. |
Output | Optional | The schema your script's result is mapped to for downstream data pills. |
Run in async mode | Optional, off by default | Pauses the automation and resumes it when the script finishes; useful for long-running scripts. |
Input Files | Optional | Files made available to the script by name. |
Output Files Pattern | Optional | A glob pattern (for example |
Capture standard output | Optional | Captures the script's stdout/stderr for the run log. |
Note: The output shape is for mapping convenience and is not strictly enforced. Make sure your script actually returns the keys you declared — a mismatch causes silent null values downstream.
Python Environment
Python runs on versions 3.8 through 3.13, defaulting to 3.12. Choose how to set up the environment in Python environment selection:
Quick Start (Python 3.12, default packages) — a default environment with common data packages pre-installed. Simple scripts just work.
Custom Setup (choose Python version & packages) — pick the Python version and list the exact packages to install.
Pre-configured virtual environment — a saved configuration that pins a version and a known set of packages for reuse across automations.
Execution Behavior
Scripts run in an isolated sandbox with no implicit access to the host or other scripts' state. For longer-running scripts, enable asynchronous execution — the automation pauses, the script runs independently, and the run resumes when it finishes. Asynchronous execution is available for Python, JavaScript, C# and Playwright scripts. For performance, the platform briefly caches a registered script so re-running the same code within a short window skips re-registration.
Notes
The Code Node runs best when scripts are focused, the language version matches your code, and runtime behavior is validated before going live:
Keep scripts focused and bounded — long, heavy work is better split across steps or moved to async execution.
Match the Python version to your code — syntax from a newer version will fail on an older interpreter you selected.
Playwright scripts run browser automation in the sandbox; the browser is pre-installed, no additional setup is needed.
A well-written Code Node step is short, targeted, and tested against representative sample data before it enters production.