---
title: "Execute Lua"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/nodetool/code/executelua
markdown: https://docs.nodetool.ai/nodes/nodetool/code/executelua.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/nodetool/code/executelua.md
---

# Execute Lua

**Type:** `nodetool.code.ExecuteLua`

**Namespace:** `nodetool.code`

## Description

Executes Lua code with a local sandbox (no Docker).
    lua, code, execute, sandbox

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| code | `str` | Lua code to execute as-is in a restricted environment. Dynamic inputs are provided as variables. Stdout lines are emitted on 'stdout'; stderr lines on 'stderr'. | `` |
| executable | `enum` | Lua executable to use | `lua` |
| execution_mode | `enum` | Execution mode: 'docker' or 'subprocess' | `subprocess` |
| timeout_seconds | `int` | Max seconds to allow execution before forced stop | `10` |
| stdin | `str` | String to write to process stdin before any streaming input. Use newlines to separate lines. | `` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| stdout | `str` |  |
| stderr | `str` |  |

## Related Nodes

Browse other nodes in the [nodetool.code](./) namespace.
