nLink Code (Polyglot)
The Code node is the ultimate escape hatch for advanced users. When built-in nodes don't cover your specific edge case, you can write raw scripts or inject compiled WebAssembly to manipulate data arrays, perform complex mathematical calculations, or transform object structures exactly how you need them.
What can you do with nLink Code (Polyglot)?
Complete Flexibility (Run Modes)
Choose between running code once per item or once for the entire array payload. Execute standard ES6 JavaScript natively within your workflow.
Workspace Environment Variables
Securely access nLink Workspace Environment variables dynamically via $env to prevent hardcoding API secrets.
Zero Server Infrastructure
Write code directly in the browser editor. We securely execute your custom scripts in isolated backend V8 sandboxes without you ever needing to provision or manage servers.
Detailed Usage & Configuration
The nLink Code Node is an advanced developer tool providing raw native programmatic capabilities without deploying microservices. Write bespoke functional logic in standard ES6 Javascript inside heavily guarded, isolated V8 backend sandboxes.
1. Run Modes & Data Arrays
You can control exactly how the code executes against your workflow data:
- Run Once for Each Item: (Default) The code executes multiple times in a loop, once for every item in the input. The current item is accessible via
$json. - Run Once for All Items: The code executes only once. The entire array of input items is accessible via
$input.all(). This is essential for merging, reducing, or aggregating multiple rows into a single payload.
Because nLink executes iteratively over deeply nested arrays, your programmatic output MUST securely return an explicitly formatted array (e.g., return [{json: {...}}]) if you are returning multiple items.
2. Secret Management ($env)
Never hardcode API keys or secrets in your JavaScript code. The Sandbox automatically injects the Workspace Environment variables directly into the $env object. This ensures your code only accesses configurations strictly belonging to your active Workspace (e.g. $env.STRIPE_SECRET).
3. Security Restraints
Scripts execute in a highly isolated container specifically constructed for programmatic computation. The Node has built-in http helper to make requests, but for full resilience, routing and payload dispatch should always connect specifically to the subsequent HTTP Request Node.
