> Documentation index for agents: https://docs.rocketride.ai/llms.txt

# response

A RocketRide infrastructure node that captures pipeline output and returns it to the requesting client as a structured JSON response.

## What it does

Acts as the terminal node in pipelines triggered via HTTP: it collects everything arriving on its input lanes and writes it into the request's JSON response body, with each lane's data stored under a configurable result key. It handles the response phase of the HTTP request-response cycle, so the client receives all pipeline results in a single standardized JSON object.

When an object finishes processing, the node also copies the object's name, path (the containing directory, with the file name stripped), and metadata (all keys except Tika-derived ones, which are filtered out) into the response. It also records a `result_types` map that ties each result key back to its original lane type.

Data handling per lane:

- **text** - chunks are accumulated (joined with blank lines) and appended as one string per object.
- **table**, **documents**, **questions** - appended as-is; documents and questions are serialized to plain dicts.
- **json** - appended as-is (one entry per write).
- **answers** - appended as parsed JSON when the answer is JSON, otherwise as plain text.
- **hash** - unlike the others, this is not lane data: **Return Fingerprint** reads the object's own `componentId` when the object completes and appends it under the configured key, whether or not the pipeline set one. Its `tags` lane (shown as **data** in the UI) only places the component in the pipeline; nothing arriving on it is read.
- **image**, **audio**, **video** - the three multimedia lanes are handled identically: streamed chunks are buffered via AVI_ACTION signals (BEGIN / WRITE / END), then the complete stream is base64-encoded and appended as `{"mime_type": ..., "<lane>": ...}`, where `<lane>` is the payload key (`image` / `audio` / `video`). When the stream's BEGIN carries a stream descriptor, a sanitized projection of it is added as a `metadata` object (source provenance: mime, size, dimensions/duration, codec, and any nested `source` chain; the identity/security backlink is stripped). The `metadata` key is omitted when no descriptor arrived.

The node has no Python dependencies of its own (`requirements.txt` is empty); it relies on the separately installed AI module for document, question, and answer schemas and for image processing.

---

### Service variants

The same implementation is registered as eleven services. The generic **HTTP Results** service (`response://`) accepts all nine lane types and lets you map each lane to its own result key. Ten single-lane variants accept exactly one lane each and expose a single `laneName` field:

| Service title      | Protocol                  | Lane        | Default result key |
|--------------------|---------------------------|-------------|--------------------|
| HTTP Results       | `response://`             | all nine    | the lane type name |
| Return Answers     | `response_answers://`     | `answers`   | `answers`          |
| Return Audio       | `response_audio://`       | `audio`     | `audio`            |
| Return Documents   | `response_documents://`   | `documents` | `documents`        |
| Return Fingerprint | `response_hash://`        | `tags`      | `hash`             |
| Return Image       | `response_image://`       | `image`     | `image`            |
| Return JSON        | `response_json://`        | `json`      | `json`             |
| Return Questions   | `response_questions://`   | `questions` | `questions`        |
| Return Table       | `response_table://`       | `table`     | `table`            |
| Return Text        | `response_text://`        | `text`      | `text`             |
| Return Video       | `response_video://`       | `video`     | `video`            |

All variants are `classType: infrastructure` and register as a `filter`. The generic `response://` service additionally carries the `internal` capability.

---

## Lanes

All lanes are inputs; the node produces no output lanes.

| Lane in     | Lane out | Description |
|-------------|----------|-------------|
| `text`      | -        | Captured under the configured key |
| `table`     | -        | Captured under the configured key |
| `json`      | -        | Captured under the configured key |
| `documents` | -        | Captured under the configured key |
| `questions` | -        | Captured under the configured key |
| `answers`   | -        | Captured under the configured key |
| `audio`     | -        | Captured under the configured key (base64-encoded stream + descriptor `metadata`) |
| `video`     | -        | Captured under the configured key (base64-encoded stream + descriptor `metadata`) |
| `image`     | -        | Captured under the configured key (base64-encoded stream + descriptor `metadata`) |
| `tags`      | -        | **Return Fingerprint** only; the payload is ignored - the object's `componentId` is captured under the configured key |

## Configuration

Choose the generic HTTP Results service when one response needs several lane types, and use a single-lane variant when a pipeline has one terminal output. The generated schema contains the field definitions; the guidance below covers the effect of the result-key setting.

### Lane name and result key

For HTTP Results, each `lanes` entry maps a lane identifier to a result key of one to 32 characters. Use distinct keys when a client needs to distinguish returned types without consulting `result_types`; leave a lane unmapped to use its lane type as the key. In a single-lane service, the top-level `laneName` takes precedence over the `lanes` mapping, so set it only when every arriving result should use the same key.

A result key cannot be `result_types`, `name`, `path`, `metadata`, `objectId`, `error` or `status`: the result object already holds those, so lane data under one of them would be overwritten or break the node. Validating the configuration warns about such a key, and the node refuses to start with one.

---

## Notes

### Response format

The JSON object returned to the client has the following structure:

```json
{
  "name": "file.pdf",
  "path": "/some/directory",
  "metadata": { "...": "..." },
  "your_key": [ "...data..." ],
  "result_types": { "your_key": "answers" }
}
```

Each configured result key holds an array: one element per result produced for the object. `result_types` maps each configured key back to its original lane type, so clients can identify the kind of data each key contains even when custom key names are used. The `name`, `path`, and `metadata` fields are only present when the processed object carries those attributes; `metadata` excludes all Tika-derived keys.

For the multimedia lanes (`image`, `audio`, `video`) each array element is a media entry with the same shape — the base64 stream under the lane key plus the stream descriptor:

```json
{
  "mime_type": "image/png",
  "image": "<base64-encoded bytes>",
  "metadata": {
    "source_mime": "image/png",
    "size": 583006,
    "width": 1280,
    "height": 720,
    "name": "clip.frame0.png",
    "source": { "source_mime": "video/mp4", "duration": 74.05, "...": "...(nested origin chain)" }
  }
}
```

The `metadata` object is the **sanitized provenance projection** of the stream descriptor parsed from the media BEGIN — the media detail (mime, size, dimensions/duration, codec) plus the nested `source` chain, which chains back through each transform hop to the original media (nested to any depth). The identity/security backlink (`objectId`, `parent`, `permissionId`, `signature`, `nodeId`) is intentionally stripped and never reaches the client. `metadata` is omitted entirely when the stream arrives without a descriptor.

---

<!-- ROCKETRIDE:GENERATED:PARAMS START -->
<!-- Generated by nodes:docs-generate. Do not edit by hand. -->

## Schema

### Return Answers (`services.answers.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"answers"` |

### Return Audio (`services.audio.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"audio"` |

### Return Documents (`services.documents.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"documents"` |

### Return Fingerprint (`services.hash.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"hash"` |

### Return Image (`services.image.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"image"` |

### HTTP Results (`services.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneId` | `string` | **Lane name** |  |
| `laneName` | `string` | **Result key** |  |
| `lanes` | `array` | **Lanes**<br/>Each lane maps pipeline data to a custom JSON key in the response. Select the data type (text, documents, answers, etc.) for Lane Name, and enter a custom JSON key name (1-32 characters) for Result Key. |  |

### Return JSON (`services.json.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"json"` |

### Return Questions (`services.questions.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"questions"` |

### Return Table (`services.table.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"table"` |

### Return Text (`services.text.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"text"` |

### Return Video (`services.video.json`)

| Field | Type | Description | Default |
|---|---|---|---|
| `laneName` | `string` | **Identifier key within result** | `"video"` |

## Source

[<svg viewBox="0 0 16 16" width="15" height="15" fill="currentColor" aria-hidden="true" style="vertical-align:-0.15em;margin-right:0.35em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg> View source](https://github.com/rocketride-org/rocketride-server/tree/develop/nodes/src/nodes/response)
<!-- ROCKETRIDE:GENERATED:PARAMS END -->
