Skip to main content
The Merge step takes two JSON arrays and combines them into one. Use it to join customer records with their order history, concatenate results from two API calls, pair items by position, or generate every possible combination of two lists. Four merge modes cover the most common data combination patterns — from a simple concatenation to a full relational join.

Configuration

1

Input A

An expression resolving to the first JSON array — for example, {{Steps.Fetch_Customers.Output.Body.data}}.
2

Input B

An expression resolving to the second JSON array — for example, {{Steps.Fetch_Orders.Output.Body.data}}.
3

Mode

The merge strategy. See the detailed breakdown below.
4

Field A / Field B (Merge by Field only)

When using Merge by Field mode, specify the field name in each array to match on. Items are joined where A[fieldA] equals B[fieldB].

Merge modes

Concatenates the two arrays end-to-end. All items from A appear first, followed by all items from B.
A: [{ "id": 1 }, { "id": 2 }]
B: [{ "id": 3 }, { "id": 4 }]

Result: [{ "id": 1 }, { "id": 2 }, { "id": 3 }, { "id": 4 }]
Result size: A.length + B.lengthUse when: You have two result sets of the same type and want a single combined list — for example, merging products from two different API calls.

Property conflicts

When two objects are merged (in all modes except Append), properties from Input B override Input A if both have the same key:
A item: { "name": "Alice", "status": "active" }
B item: { "status": "vip", "score": 95 }

Merged: { "name": "Alice", "status": "vip", "score": 95 }
The merge is shallow — only top-level properties are combined. Nested objects are replaced entirely, not recursively merged.

Output

The step returns a JSON array containing the merged items.
{{Steps.Merge.Value}}  →  [ ...merged items... ]

Use case: enrich support tickets with customer data

A customer support agent needs to display recent tickets alongside the customer’s account details. Tickets come from one API and customer profiles from another. They share a customerId field. Agent flow:
Input → Fetch Tickets (HTTP) ─┐
                               ├→ Merge → Format Response (AI Model)
Input → Fetch Customers (HTTP) ┘
Merge configuration:
SettingValue
Input A{{Steps.Fetch_Tickets.Output.Body.data.tickets}}
Input B{{Steps.Fetch_Customers.Output.Body.data.customers}}
ModeMerge by Field
Field AcustomerId
Field Bid
What happens at runtime:
// Input A — tickets
[
  { "ticketId": "T-101", "customerId": "C-1", "subject": "Login issue", "priority": "high" },
  { "ticketId": "T-102", "customerId": "C-2", "subject": "Billing question", "priority": "low" },
  { "ticketId": "T-103", "customerId": "C-9", "subject": "Feature request", "priority": "medium" }
]

// Input B — customers
[
  { "id": "C-1", "name": "Acme Corp", "plan": "Enterprise", "csm": "Jane" },
  { "id": "C-2", "name": "StartupCo", "plan": "Starter", "csm": "Mike" }
]
The Merge step returns:
[
  { "ticketId": "T-101", "customerId": "C-1", "subject": "Login issue", "priority": "high",
    "id": "C-1", "name": "Acme Corp", "plan": "Enterprise", "csm": "Jane" },
  { "ticketId": "T-102", "customerId": "C-2", "subject": "Billing question", "priority": "low",
    "id": "C-2", "name": "StartupCo", "plan": "Starter", "csm": "Mike" }
]
  • T-101 and T-102 are enriched with their customer’s name, plan, and CSM.
  • T-103 is excluded because customer C-9 does not exist in the customers list.
  • The AI Model step can now draft a response that references both the ticket details and the customer context.

Tips

Use Append followed by a Sort step when combining results from multiple sources that need to be presented in a unified, ordered list — for example, merging search results from two knowledge bases and sorting by relevance score.
Merge by Field performs a type-safe comparison — a numeric 1 and a string "1" are treated as different values. Ensure your join fields use consistent types across both inputs.
If an item in Input A or Input B is not a JSON object (e.g., it is a string or number), the merge returns the Input B value as-is. Object merging only applies when both items are JSON objects.