Skip to content

Merge Data Task

Overview

The Merge Data Task consolidates output variables from parent tasks into named variables for easier reference. Use it to simplify complex workflows by creating clean, descriptive variable names from nested task outputs.

When to use this task:

  • Simplify deeply nested variable references
  • Create descriptive names for workflow data
  • Consolidate data from multiple parent tasks
  • Improve workflow readability
  • Pass selected data to child tasks
  • Rename variables for clarity
  • Extract specific fields from complex objects
  • Standardize variable naming

Key Features:

  • Merge any parent task output
  • Create custom variable names
  • Shorthand suffix matching (.email, .phone, etc.)
  • First non-empty value wins
  • Processes before standard variable replacement
  • Supports unlimited mappings
  • Simplifies complex workflows

Quick Start

  1. Add Merge Data task
  2. Map parent task outputs to new names
  3. Use new variable names in child tasks
  4. Save

Simple Example:

customer_name = {{task_15001_full_name}}
customer_email = {{task_15001_email}}
customer_phone = {{task_15001_cell}}

Use: {{task_53001_customer_name}} instead of {{task_15001_full_name}}

Configuration

Standard Mapping

Map any variable to a new name:

company = {{task_15001_company_name}}
contact = {{task_15001_full_name}}
email = {{task_15001_email}}
phone = {{task_15001_cell}}

Access merged data:

{{task_53001_company}}
{{task_53001_contact}}
{{task_53001_email}}
{{task_53001_phone}}

Shorthand Syntax

Use suffix matching for common fields:

email = .email
phone = .phone  
name = .full_name
company = .company_name

How it works: - Searches ALL parent task outputs - Matches variable names ending with suffix - Returns first non-empty match found - Example: .email matches task_15001_email, task_55001_email, etc.

Complex Object Extraction

Extract nested data:

order_id = {{task_46001_order.id}}
order_total = {{task_46001_order.total}}
customer_id = {{task_46001_customer.id}}
customer_tier = {{task_46001_customer.tier}}

Multiple Source Priority

Merge with fallback:

phone = {{task_15001_cell}}
phone = {{task_55001_phone}}
phone = {{task_19001_value}}

First non-empty value is used (reads top to bottom).

Output Fields

All mapped variables become outputs with prefix task_53001_:

Mapped Name Output Variable Example
customer_name task_53001_customer_name John Smith
email task_53001_email john@company.com
phone task_53001_phone +15551234567
order_total task_53001_order_total 1250.00

Real-World Examples

Example 1: Email Template with Clean Variables

Workflow: 1. Form Submission - Website inquiry 2. Match to Client - Find existing contact 3. AI Prompt - Generate response 4. Merge Data - Simplify variables 5. Email - Send response

Merge Variables:

name = {{task_15001_full_name}}
email = {{task_15001_email}}
company = {{task_15001_company_name}}
phone = {{task_15001_cell}}
inquiry = {{task_55001_message}}
response = {{task_38001_response}}
source = {{task_55001_utm_source}}

Send Email (Clean and Readable):

To: {{task_53001_email}}
Subject: Re: Your Inquiry - {{task_53001_company}}

Hi {{task_53001_name}},

Thank you for your inquiry about:
{{task_53001_inquiry}}

{{task_53001_response}}

We'll follow up with you at {{task_53001_phone}} within 24 hours.

Best regards,
Sales Team

P.S. We see you found us via {{task_53001_source}} - welcome!

Without Merge Data (Hard to Read):

To: {{task_15001_email}}
Subject: Re: Your Inquiry - {{task_15001_company_name}}

Hi {{task_15001_full_name}},

Thank you for your inquiry about:
{{task_55001_message}}

{{task_38001_response}}

We'll follow up with you at {{task_15001_cell}} within 24 hours.

Example 2: Shorthand Suffix Matching

Workflow: 1. Webhook In - Order data from e-commerce 2. Match to Client - Find customer 3. Code Task - Calculate totals 4. Merge Data - Use shorthand 5. MySQL Query - Store order 6. Email - Order confirmation

Merge with Shorthand:

email = .email
phone = .phone
full_name = .full_name
company_name = .company_name
order_id = .order_id
order_total = .total

Shorthand automatically finds: - .emailtask_15001_email or task_46001_customer_email (first found) - .phonetask_15001_cell or task_46001_phone - .order_idtask_46001_order_id - .totaltask_42001_order_total or task_46001_total

Store Order:

Query: INSERT INTO orders (customer_email, phone, order_id, total, status)
       VALUES (?, ?, ?, ?, 'pending')
Parameters: 
  {{task_53001_email}}
  {{task_53001_phone}}
  {{task_53001_order_id}}
  {{task_53001_order_total}}

Example 3: Multi-Step Workflow Consolidation

Workflow: 1. Form Submission - Lead form 2. Coalesce - Best phone 3. Coalesce - Best email 4. Phone Formatter - Format phone 5. Match to Client - Find existing 6. Code Task - Calculate score 7. Merge Data - Consolidate everything 8. Multiple child tasks use merged data

Merge Consolidated Data:

form_name = {{task_55001_name}}
form_company = {{task_55001_company}}
form_message = {{task_55001_message}}
best_phone = {{task_19001_value}}
best_email = {{task_19002_value}}
formatted_phone = {{task_24001_formatted}}
client_id = {{task_15001_client_id}}
contact_id = {{task_15001_contact_id}}
existing_client = {{task_15001_found}}
lead_score = {{task_42001_score}}
lead_grade = {{task_42001_grade}}
utm_source = {{task_55001_utm_source}}
utm_campaign = {{task_55001_utm_campaign}}

Now All Child Tasks Use Clean Names:

Email Task: {{task_53001_best_email}}
SMS Task: {{task_53001_formatted_phone}}
If Task: {{task_53001_lead_score}} > 80
Workflow Note: {{task_53001_client_id}}
MySQL Query: {{task_53001_contact_id}}

Example 4: API Response Extraction

Workflow: 1. Webhook Out - Call external API 2. Merge Data - Extract API response fields 3. If Task - Check API success 4. New Client - Create from API data 5. Email - Send confirmation

Extract API Response:

api_success = {{task_1001_response.success}}
api_customer_id = {{task_1001_response.data.customer.id}}
api_customer_name = {{task_1001_response.data.customer.name}}
api_customer_email = {{task_1001_response.data.customer.email}}
api_subscription_id = {{task_1001_response.data.subscription.id}}
api_subscription_plan = {{task_1001_response.data.subscription.plan}}
api_subscription_status = {{task_1001_response.data.subscription.status}}
api_error_message = {{task_1001_response.error.message}}

Check Success:

Condition: {{task_53001_api_success}} = true
True: Create client with API data
False: Send error notification

Create Client (Success Path):

Company Name: {{task_53001_api_customer_name}}
Status: Customer
Contact Email: {{task_53001_api_customer_email}}
Custom Field: External ID = {{task_53001_api_customer_id}}
Custom Field: Subscription Plan = {{task_53001_api_subscription_plan}}
Custom Field: Subscription Status = {{task_53001_api_subscription_status}}

Best Practices

Variable Naming

  1. Descriptive names - customer_email not email1
  2. Consistent convention - snake_case throughout
  3. Avoid conflicts - Don't reuse existing task field names
  4. Group related - Prefix related fields (order_id, order_total, order_date)

Good names:

customer_name = {{task_15001_full_name}}
customer_email = {{task_15001_email}}
order_total = {{task_42001_calculated_total}}
lead_score = {{task_42001_score}}

Poor names:

n = {{task_15001_full_name}}
e = {{task_15001_email}}
total = {{task_42001_calculated_total}}
score = {{task_42001_score}}

When to Use Merge Data

Good use cases: - Complex workflows with 5+ tasks - Variables used in multiple places - Nested object extraction - Improving readability - Template-heavy workflows (emails, PDFs)

Don't need it for: - Simple 2-3 task workflows - Variables used only once - Already simple variable names

Shorthand vs. Explicit

Use Shorthand when: - Common field names (email, phone, name) - Don't care which parent task it comes from - Want first non-empty value automatically

Use Explicit when: - Need specific task's output - Multiple tasks have same field name - Order matters for your logic

Workflow Organization

Place Merge Data task: 1. After data collection - After all source tasks complete 2. Before usage - Before tasks that need clean variables 3. Strategic placement - Can have multiple Merge Data tasks at different stages

Troubleshooting

Variable Not Found

Issue: Merged variable returns empty or doesn't exist

Causes: - Source variable doesn't exist - Typo in variable reference - Parent task didn't execute - Source field is actually empty

Debug: Add Code task to inspect

return {
  source_value: input.task_15001_email || 'NOT FOUND',
  merged_value: input.task_53001_email || 'NOT FOUND'
};

Shorthand Not Matching

Issue: Shorthand .email not finding value

Causes: - No parent task has variable ending in "email" - All matching variables are empty - Case sensitivity (.Email vs .email)

Solution: Use explicit mapping instead

email = {{task_15001_email}}

Wrong Value Selected

Issue: Shorthand picked unexpected task's value

Cause: First matching non-empty value wins (order not guaranteed)

Solution: Use explicit mapping with priority

email = {{task_15001_email}}
email = {{task_55001_email}}
email = {{task_46001_email}}
First non-empty from top to bottom.

Variable Name Collision

Issue: Merged variable name conflicts with system field

Cause: Used reserved name like client_id, task_id

Solution: Add prefix to avoid conflicts

merged_client_id = {{task_15001_client_id}}
merged_contact_id = {{task_15001_contact_id}}

Frequently Asked Questions

How many variables can I merge?

Unlimited. Add as many mappings as needed.

Can I merge from non-parent tasks?

No. Only parent tasks in the workflow tree are accessible.

Can I use merged variables in subsequent Merge Data tasks?

Yes, you can nest Merge Data tasks and reference previous merges.

Does it work with arrays and objects?

Yes, but you need to reference specific properties:

item_name = {{task_29001_item.name}}
item_price = {{task_29001_item.price}}

What if multiple mappings have same name?

First non-empty value wins (top to bottom).

Can I merge Loop iteration variables?

Yes, useful inside loops:

current_item = {{task_29001_item}}
current_index = {{task_29001_index}}

How does shorthand matching work exactly?

Searches all parent outputs, matches suffix, returns first non-empty. Example: .email matches any variable ending in "email".


  • Variable - Store temporary data in workflow
  • Coalesce - Select first non-empty from options
  • Code Task - Complex data transformations
  • If Task - Use merged variables in conditions
  • Loop - Merge loop iteration data
  • Formatter - Format merged data