Skip to main content
View source

Response

View as Markdown

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.
  • answers - appended as parsed JSON when the answer is JSON, otherwise as plain text.
  • image - streamed chunks are buffered via AVI_ACTION signals (BEGIN / WRITE / END), then the complete image is base64-encoded and appended as {"mime_type": ..., "image": ...}.
  • audio, video - the raw bytes are not returned; only tracking metadata is appended: {"url", "aviAction", "mimeType", "size"}.

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 nine services. The generic HTTP Results service (response://) accepts all eight lane types and lets you map each lane to its own result key. Eight single-lane variants accept exactly one lane each and expose a single laneName field:

Service titleProtocolLaneDefault result key
HTTP Resultsresponse://all eightthe lane type name
Return Answersresponse_answers://answersanswers
Return Audioresponse_audio://audioaudio
Return Documentsresponse_documents://documentsdocuments
Return Imageresponse_image://imageimage
Return Questionsresponse_questions://questionsquestions
Return Tableresponse_table://tabletable
Return Textresponse_text://texttext
Return Videoresponse_video://videovideo

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


Configuration

Lanes

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

Lane inLane outDescription
text-Captured under the configured key
table-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 (tracking metadata only, not raw bytes)
video-Captured under the configured key (tracking metadata only, not raw bytes)
image-Captured under the configured key (base64-encoded)

HTTP Results (generic service)

FieldTypeDescription
laneIdstring
laneNamestring
lanesarrayEach 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.

Multiple lane-to-key mappings can be added to return several outputs in a single response. When no mapping is configured for a lane, its data is stored under the lane type name as the default key.

Single-lane variants (Return Answers, Return Text, ...)

FieldType / DefaultDescription
laneNamestring, defaults to the lane typeThe JSON key under which this lane's data appears in the response body (1-32 characters).

When laneName is set at the top level of the node config (the style used by all single-lane variants), it overrides the lanes array and every lane type arriving at the node is written under that one key. The per-lane lanes mapping only applies when no top-level laneName is configured.


Response format

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

{
"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.


Schema

Return Answers (services.answers.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"answers"

Return Audio (services.audio.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"audio"

Return Documents (services.documents.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"documents"

Return Image (services.image.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"image"

HTTP Results (services.json)

FieldTypeDescriptionDefault
laneIdstringLane name
laneNamestringResult key
lanesarrayLanes
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 Questions (services.questions.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"questions"

Return Table (services.table.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"table"

Return Text (services.text.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"text"

Return Video (services.video.json)

FieldTypeDescriptionDefault
laneNamestringIdentifier key within result"video"