> ## Documentation Index
> Fetch the complete documentation index at: https://www.wirebase.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Code node

> Transform data in a workflow with sandboxed JavaScript.

## Overview

The Code node runs your JavaScript on the server in an isolated sandbox. Use it for deterministic transformations that would be awkward or unreliable with an LLM: parsing, filtering, math, reshaping JSON.

## How it works

Your code is the **body of a function**:

* Inputs arrive on a `params` object.
* `return` a value to produce the node's output. It must be JSON-serializable.

### Params

Under **Params**, add keys and set each value to a literal or a `/` reference to an earlier node's output. Inside your code, read them as `params.<key>`.

### Result schema

Optionally describe the returned value's shape under **Result Schema** so later nodes can reference its individual fields. Leave it as-is to keep the output an untyped object.

## Example

With params `orders` (referencing an HTTP node's response) and `minTotal` set to `100`:

```javascript theme={null}
const big = params.orders.filter((o) => o.total >= Number(params.minTotal));

return {
  count: big.length,
  revenue: big.reduce((sum, o) => sum + o.total, 0),
  ids: big.map((o) => o.id),
};
```

## Limits

| Limit | Value |
| - | - |
| Runtime | Synchronous JavaScript only: no `await`, timers or promises. |
| Network and files | None. Use an **HTTP** node to fetch data, then pass it in as a param. |
| Timeout | 10 seconds by default, up to 30 seconds. |
| Memory | 64 MB. |
| Code size | 64,000 characters. |
| Console output | `console.log` output is captured (up to 100 entries) to help you debug. |

## Debugging tips

* Click **Run** in the workflow editor, enter test inputs, and open each node's result to inspect what it received and returned.
* Throw an `Error` with a clear message when input isn't what you expect; the workflow stops and shows it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.