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

> Run a sandboxed Python 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-2" pipe="Value" scope="Any" tool="No" type="utl.eval.python">



</block-meta>

**Execute Python** runs a sandboxed Python script and writes the return value to the data pipe. Prefer built-in blocks when they cover the step. The inspector matches [Execute JS](https://docs.vettero.com/build/workflows/blocks/utility/execute-js): **Input** becomes `args`; you can use `ctx` to get, set, or unset 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).

## Configure

<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>
      Python 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
    </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

- Numeric or text transforms that are awkward as a chain of data blocks.
- Same pattern as Execute JS when the team prefers Python.

<block-page-nav>



</block-page-nav>


## Sitemap

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