Response
The Response block ends a workflow and returns a structured HTTP response to the caller. Use it with an API deployment to control the exact body, status code, and headers that come back.
Configuration
Response Data Mode
Builder lays out the response body field by field with types; Editor is a raw JSON code editor. Builder fits most cases.
Response Data
The body sent back, as JSON. Reference any earlier value: a block output like <agent.content> with a connection tag, or a workflow variable like <variable.userId>. Nest objects and arrays freely.
{
"query": "<start.input>",
"answer": "<agent.content>",
"model": "<agent.model>"
}Status Code
Any valid HTTP status code; defaults to 200. Set 4xx or 5xx on error branches (201 created, 400 bad request, 404 not found, 500 server error).
Response Headers
Extra response headers, as key-value pairs:
| Key | Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| X-API-Version | 1.0 |
Outputs
A Response block is a terminal block, so nothing reads from it. Its data, status, and headers become the HTTP response itself. A workflow with no Response block returns its last block's output by default; add a Response block when you need exact HTTP control.
Don't place a Response block in parallel with blocks that have important side effects. Order across parallel branches is non-deterministic, so the Response may fire before or after them on any given run.
Examples
Return data from an API endpoint
The Response block reads <agent.content> into its body and returns 200 to the API caller.
Acknowledge a webhook
After processing the payload, the Response block returns a small confirmation so the sender knows the event was received.
Return a different status per branch
A Condition routes valid requests to a 200 Response and invalid ones to a 400. The first Response to run determines what the caller gets.
Best Practices
- Use accurate status codes.
2xxfor success,4xx/5xxfor errors, set per branch. - Keep a consistent response shape across your endpoints so callers can rely on it.
- Return a different response per outcome. Put a Response on each branch after a Condition or Router.
- Check your references resolve. A connection tag pointing at a block that did not run comes back empty, so set fields on the branch that produces them.