Response Block
Send structured API response
Transform your workflow's variables into a structured HTTP response for API calls. Define response data, status code, and headers. This is the final block in a workflow and cannot have further connections.
Overview
| Property | Value |
|---|---|
| Type | response |
| Category | blocks |
| Color | #EA580C |
When to Use
- End an API-triggered workflow by returning a structured JSON payload to the caller
- Set a custom HTTP status code (e.g.
201 Created,400 Bad Request) on the response - Attach extra HTTP headers (e.g.
Content-Type,X-Request-Id) to the response - Build a response body interactively using the visual Builder, referencing upstream block outputs via
{{blockName.field}} - Compose a raw JSON response body in the Editor when you need full control over the payload structure
- Finalize any workflow that is invoked as a webhook or via the Zelaxy public API
Configuration
Response Data Mode (dataMode)
Controls how you define the response body. This is a required dropdown with two options:
| Label | ID | Description |
|---|---|---|
| Builder | structured | Visual field builder — add named fields and map them to workflow variables using {{variable.name}} syntax |
| Editor | json | Raw JSON code editor — write the full JSON payload directly |
Response Structure (builderData)
Visible when dataMode is structured.
A visual response-format builder where you define named output fields and their values. Reference upstream block outputs using {{blockName.field}} and workflow variables using {{variable.name}}.
Response Data (data)
Visible when dataMode is json.
A JSON code editor for the full response body. Use {{blockName.field}} to inject values from upstream blocks and {{ENV_VAR_NAME}} to reference environment variables.
Example placeholder:
{
"message": "Hello world",
"userId": "{{variable.userId}}"
}An AI wand is available to generate or revise the JSON body from a plain-language prompt.
Status Code (status)
Optional. HTTP status code to return with the response. Defaults to 200 if left blank. Accepts any valid HTTP integer code (e.g. 200, 201, 400, 404, 500).
Response Headers (headers)
Optional. A key-value table of additional HTTP headers to include in the response (e.g. Content-Type: application/json, X-Custom-Header: value).
Inputs & Outputs
Inputs:
dataMode(string) — Response data definition mode (structuredorjson)builderData(json) — Structured response data built with the visual builderdata(json) — JSON response body written in the raw editorstatus(number) — HTTP status codeheaders(json) — Response headers as key-value pairs
Outputs:
data(json) — Response data that was sent as the bodystatus(number) — HTTP status code that was returnedheaders(json) — Response headers that were sent
Tools
This block does not call any external tools. It is a terminal block that packages the workflow's results into an HTTP response and returns them directly to the caller.
YAML Example
response_1:
type: response
name: "Response"
inputs:
dataMode: "json"
data: |
{
"userId": "{{trigger.params.userId}}",
"result": "{{agent1.content}}",
"score": {{evaluator1.result.score}}
}
status: 200
headers:
- key: "Content-Type"
value: "application/json"
connections:
outgoing: []