> For the complete documentation index, see [llms.txt](https://docs.diaflow.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.diaflow.io/workflow-builder/nodes/built-in-tools/merge-json-multiple-data-source-to-json.md).

# Merge JSON (Multiple Data Source to JSON)

## Merge JSON (Multiple Data Source to JSON)

### Overview & The "Smart" Mechanism

The Merge JSON node gathers values from different steps and combines them into one clean record. Think of it like a project coordinator collecting updates from sales, support, and finance, then packing them into one ready-to-use briefing.

This is useful when your workflow has data scattered across several nodes and you need one structured output for the next step. It saves you from manually rebuilding that combined record every time.

#### Smart features

* **Pulls from multiple places at once** : select values from triggers and earlier nodes in one step.
* **Builds a ready-to-use record automatically** : the node combines everything into one structured output.
* **Cleans field names for you** : long or nested field paths are converted into safer, simpler field names.
* **Supports deep values** : you can pull details from nested fields, not just top-level outputs.
* **Works well for handoffs** : the output is packaged in a format that can be passed to later steps like requests, loops, prompts, or outputs.

<figure><img src="/files/AMoJY1cxCY1XU1Zl3bpJ" alt=""><figcaption></figcaption></figure>

### Common Use Cases

* Combine form details, AI-generated text, and account data into one record before sending it to another system.
* Gather customer information from several workflow steps before creating a report, email, or approval summary.
* Prepare one clean payload for a loop, table update, or outbound request without rebuilding the fields by hand.

### How to Configure

* **Input field** : Add each value you want to collect into the final record.
  * Pick fields from the trigger or previous nodes.
  * Enter one field reference per item, such as a customer email, order ID, summary, or status.
  * Use the field path only. Do not add extra brackets or wrapping text.
* Add all required fields in the order you want to manage them.
* Run the workflow and review the result. The node returns one combined record that contains all selected values.
* If you plan to use the result in a later step, select the first item from this node’s output when needed.

<figure><img src="/files/86CvjjtSBmZZcXEhpX0L" alt=""><figcaption></figcaption></figure>

### Before & After Example

**Before**

```
trigger.name = Alice Wong
trigger.email = alice@company.com
summary_node.data = Interested in enterprise plan
status_node.data.account_status = active
```

**After**

```json
[
  {
    "name": "Alice Wong",
    "email": "alice@company.com",
    "summary_node_data": "Interested in enterprise plan",
    "status_node_data_account_status": "active"
  }
]
```

### Important Warnings & Best Practices

* This node returns a **one-item record list**, not a single standalone record. If a later step expects one record, make sure you use the first item.
* If two selected fields turn into the same final field name, the later value replaces the earlier one. Review similar field names carefully before saving.
* Field names are created automatically from the source path. If you need shorter or more business-friendly names, add a follow-up transformation step.
* Some numbers or yes/no values may arrive as text depending on the source node. Double-check important values before using them in conditions or calculations.
* If a selected field cannot be found, the output may contain an empty value or unresolved text. Test the flow once to confirm every field is available.
* If you leave the field list empty, the node still returns an empty record. Make sure you add at least the fields you need.

### Need help?

* Learn the basics in [How a node works](/getting-started/lets-start-with-the-basics/how-a-node-works.md)
* Build the full flow in [Create a workflow](/workflow-builder/create-a-workflow.md)
* Browse related nodes in [Component List](/workflow-builder/component-list.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.diaflow.io/workflow-builder/nodes/built-in-tools/merge-json-multiple-data-source-to-json.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
