# Set Response

<!-- meta: type=set-response; location=Logic; category=Logic; platforms=Joomla and WordPress (where applicable) -->

## Overview

Returns plain text, HTML, JSON, or binary media as the HTTP response — ideal after a Custom Events webhook trigger.

This step executes when the flow reaches it along a wired path. It does not call external services by itself unless combined with API or CMS steps — it shapes *how* the flow continues.

## Why use this node

Set Response is a **logic step** in the **Logic** group. Logic steps control how data moves through the flow: branch on conditions, loop over lists, pause, merge parallel paths, or reshape payloads.

Typical reasons teams add **Set Response** to a flow:

- Return JSON status to a caller that hit your inbound webhook
- Serve a plain-text or HTML acknowledgement for form posts
- Stream generated file bytes back to the HTTP client

## Example workflows

Common patterns on the canvas:

1. **Trigger** → **Set Response** → **Send Email** / **API REST POST**
2. Parallel branches → **Merge** → **Set Response** → downstream action

## How to set it up

On Design, pick a format. Plain/HTML use a text body with {{placeholders}}. JSON uses the same visual shape editor as Set JSON. Media points at upstream file bytes (e.g. {{node_5.body}} from retrieve-media) or a URL.

## Good to know

Set JSON remains available when you only need to shape payload JSON without controlling Content-Type. Set Response sends the correct Content-Type for each format to webhook callers.

## Properties panel

The designer shows these tabs for this node:

| Tab | Purpose |
|-----|---------|
| **Info** | Plain-language description and output payload fields for downstream steps |
| **General** | Canvas label and read-only node ID |
| **AI** | Optional assistant to help draft settings from plain language |
| **Design** | Node-specific configuration fields |

### System (automatic — not edited by the user)

These fields are managed by the designer or runtime — you do not type into them directly:

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `_nodeId` | Node ID | `node-id` | No | — | — |
| `_payloadFields` | Available Fields | `payload-panel` | No | — | — |
| `responseJsonShape` | JSON response | `raw-json-shape-editor` | No | `setResponseShowJsonBody` | {
  "status": "ok",
  "id": "{{webhook.body.id}}"
} Same editor as Set JSON — define keys and use {{placeholders}} for values. Webhook callers receive application/json. |

### User-configured — General tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `label` | Label | `text` | No | — | Node label |

### User-configured — Design tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `mergeMode` | Apply to incoming payload | `select` (`merge` \| `replace`; default: `merge`) | No | — | Merge keeps upstream payload keys for downstream nodes. Replace drops them — typical when this node is the last step before the webhook returns. |
| `responseFormat` | Response format | `select` (`plain` \| `html` \| `json` \| `media`; default: `plain`) | No | — | Plain text and HTML return text bodies. JSON uses the same visual/raw shape editor as Set JSON. Media returns raw bytes (e.g. from retrieve-media body or a URL). |
| `responseBody` | Response body | `textarea` | No | `setResponseShowPlainBody` | OK — received {{webhook.body.id}} Text returned to webhook callers. Use {{placeholders}} from Available Fields. |
| `responseBodyHtml` | Response body (HTML) | `wysiwyg` | No | `setResponseShowHtmlBody` | <p>Hello {{webhook.body.name}}</p> HTML returned with Content-Type text/html. |
| `responseMediaSource` | Media source | `payload-text` | No | `setResponseShowMediaBody` | {{node_5.body}} or https://example.com/file.png Drag a field (e.g. retrieve-media body, S3/GCS retrieve body) or enter a URL. Resolved at runtime. |
| `responseMediaEncoding` | Media encoding | `select` (`auto` \| `base64` \| `raw` \| `url`; default: `auto`) | No | `setResponseShowMediaBody` | — |
| `responseMediaContentType` | Content-Type | `payload-text` (default: `application/octet-stream`) | No | `setResponseShowMediaBody` | image/png or {{node_5.contentType}} MIME type for the HTTP response (e.g. image/jpeg, application/pdf). Use Auto-detect from data URIs when possible. |

### CMS site configuration (not on this node's properties panel)

Credentials, API keys, mailers, SMTP, and integration defaults are configured in the CMS plugin under **Node Configuration**, not per step on this node. Link the flow to a domain before testing CMS-backed fields.

## Output payload fields

After this step runs, later nodes can reference these fields using placeholders such as
`{{set_response.response_body}}`.

| Field key | Type | Description |
|-----------|------|-------------|
| `response_body` | string | Resolved body returned to webhook callers (text, HTML, JSON string, or binary bytes). |
| `response_content_type` | string | Content-Type sent on the HTTP response (text/plain, text/html, application/json, image/*, etc.). |
| `response_format` | string | plain, html, json, or media. |
| `response_json` | object | Parsed JSON object when format is JSON (for downstream {{node.response_json.key}} paths). |
| `response_media_binary` | boolean | Boolean flag from this node's output. |
| `response_media_encoding` | string | Text value from this node's output. |
| `set_response_error` | string | Text value from this node's output. |

## Related nodes

Other steps in the same area of the palette:

- **Array to String** (`join-array-to-text`) — Logic
- **Check Condition** (`if`) — Logic
- **Filter List** (`filter-list`) — Logic
- **Logger** (`debug`) — Logic
- **Match Text** (`match-regex`) — Logic
