---
title: "Execute JS"
description: "Run a sandboxed script. Input is args; the return value is on the pipe."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/utility/execute-js"
---
# Execute JS

> Run a sandboxed script. Input is args; the return value is on the pipe.

<block-meta block="Yes" channels="Any" folder="basic/utility" group="Utility" groupTo="/build/workflows/blocks/utility" icon="i-lucide-file-code" pipe="Value" scope="Any" tool="No" type="utl.eval.js">



</block-meta>

**Execute JS** runs a sandboxed script and writes the **return** value to the data pipe. Prefer built-in blocks ([conditions](https://docs.vettero.com/build/workflows/blocks/condition), [Evaluate Math](https://docs.vettero.com/build/workflows/blocks/utility/evaluate-math), [API](https://docs.vettero.com/build/workflows/blocks/utility/api)) when they cover the step.

## Configure

The **Script** editor can complete `args` (from **Input**) and `ctx.get` / `ctx.set` / `ctx.unset` for context variables. Names passed to `ctx.set` / `ctx.unset` must be valid Liquid and JavaScript identifiers, same as [Set](https://docs.vettero.com/build/workflows/blocks/context/set).

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Name
      </strong>
    </td>
    
    <td>
      Optional label on the canvas
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Input (args)
      </strong>
    </td>
    
    <td>
      Value or variable passed into the script as <code>
        args
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Script
      </strong>
    </td>
    
    <td>
      Script body. Return the value that should go on the pipe
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Output schema (optional)
      </strong>
    </td>
    
    <td>
      Shape of the return value, so later blocks know the fields
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after the script finishes
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`). The value is whatever the script **returns** — `number`, `text`, `list`, or `object`.

If you set **Output schema** as an object, those property names are the keys on `pipe.value`.

## Use case

- Transform a nested object that other blocks cannot reshape.
- Set or read several context names in one step via `ctx`.

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
