# Set JSON

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

## Overview

Builds a JSON object from your definition and merges or replaces the incoming payload.

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 JSON 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 JSON** to a flow:

- Normalize messy webhook fields into a clean shape for downstream steps
- Add constant metadata (source, environment, timestamp) before logging
- Build nested objects for API requests from flat form fields

## Example workflows

Common patterns on the canvas:

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

## How to set it up

On Design, choose Merge or Replace, then define the JSON object. You choose every key and nested structure — use {{placeholders}} for values from earlier steps.

## Good to know

Output fields are whatever fields you define in the JSON output for this Set JSON node.

## 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 | — | — |
| `setJsonShape` | JSON to set | `raw-json-shape-editor` | **Yes** | — | {
  "key": ""
} |

### 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 | — | — |

### 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_json._shape_note}}`.

| Field key | Type | Description |
|-----------|------|-------------|
| `_shape_note` | note | Output fields are whatever fields you define in the JSON output for this Set JSON node. |

## 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
