# subprocess

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: subprocess
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: inputs/subprocess
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: inputs/subprocess.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/inputs/subprocess.adoc
page-git-created-date: "2024-05-24"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/connect/components/inputs/subprocess.md -->

**Type:** Input ▼

[Input](https://docs.redpanda.com/connect/components/inputs/subprocess/)[Output](https://docs.redpanda.com/connect/components/outputs/subprocess/)[Processor](https://docs.redpanda.com/connect/components/processors/subprocess/)

**Available in:** Self-Managed

Executes a command, runs it as a subprocess, and consumes messages from it over stdout.

#### Common

```yml
inputs:
  label: ""
  subprocess:
    name: "" # No default (required)
    args: []
    codec: lines
    restart_on_exit: false
```

#### Advanced

```yml
inputs:
  label: ""
  subprocess:
    name: "" # No default (required)
    args: []
    codec: lines
    restart_on_exit: false
    max_buffer: 65536
```

Messages are consumed according to a specified codec. The command is executed once and if it terminates the input also closes down gracefully. Alternatively, the field `restart_on_close` can be set to `true` in order to have Redpanda Connect re-execute the command each time it stops.

The field `max_buffer` defines the maximum message size able to be read from the subprocess. This value should be set significantly above the real expected maximum message size.

The execution environment of the subprocess is the same as the Redpanda Connect instance, including environment variables and the current working directory.

## [](#fields)Fields

### [](#args)`args[]`

A list of arguments to provide the command.

**Type**: `array`

**Default**: `[]`

### [](#codec)`codec`

The way in which messages should be consumed from the subprocess.

**Type**: `string`

**Default**: `lines`

**Options**: `lines`

### [](#max_buffer)`max_buffer`

The maximum expected size of an individual message.

**Type**: `int`

**Default**: `65536`

### [](#name)`name`

The command to execute as a subprocess.

**Type**: `string`

```yaml
# Examples:
name: cat

# ---

name: sed

# ---

name: awk
```

### [](#restart_on_exit)`restart_on_exit`

Whether the command should be re-executed each time the subprocess ends.

**Type**: `bool`

**Default**: `false`