---
title: "Execute Ruby"
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/executeruby
markdown: https://docs.nodetool.ai/nodes/nodetool/code/executeruby.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/nodetool/code/executeruby.md
---

# Execute Ruby

**Type:** `nodetool.code.ExecuteRuby`

**Namespace:** `nodetool.code`

## Description

Executes Ruby code with safety restrictions.
    ruby, code, execute

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| code | `str` | Ruby code to execute as-is. Dynamic inputs are provided as env vars. Stdout lines are emitted on 'stdout'; stderr lines on 'stderr'. | `` |
| image | `enum` | Docker image to use for execution | `ruby:3.3-alpine` |
| execution_mode | `enum` | Execution mode: 'docker' or 'subprocess' | `docker` |
| 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.
