Articles in this section
Category / Section

How to Send Iterator Response to Another Workflow Without Mapping All Fields Individually

4 mins read
Updated:

FlowMattic’s latest enhancement to the Iterator and Webhook Outgoing modules introduces a streamlined approach for sending iterator data to external workflows. Instead of manually mapping each field from your iterator response, you can now use a single mapping to transfer the entire data structure seamlessly. The receiving webhook will get the exact same data structure as the iterator output, making it effortless to pass data between workflows.

The Challenge with Traditional Mapping

Previously, when sending iterator data through webhooks, users had to:

  • Map each individual field from the iterator response
  • Manually configure every data parameter
  • Update mappings whenever new fields were added to the source data
  • Spend considerable time on repetitive mapping tasks

This process was not only time-consuming but also error-prone and difficult to maintain.

The New Solution: Single Field Mapping

With the new feature, FlowMattic automatically packages the entire iterator response into a single JSON object under the key current_array_item. When you map this to the iterator_item key in your webhook, FlowMattic intelligently sends the data in the same format as the original iterator output, eliminating any wrapper objects and maintaining the exact structure.

How It Works

Step 1: Set Up Your Iterator

Configure your iterator as usual to loop through your data array. The iterator will process each item and make it available for the next steps in your workflow.

Step 2: Configure the Webhook Outgoing Module

In your Webhook Outgoing module configuration:

  1. Webhook URL: Enter your destination webhook URL
  2. Data Parameters:
    • Set the key as iterator_item
    • Map the value to {{iterator2.current_array_item}} (where iterator2 is your iterator step name)
Data Parameters:
Key: iterator_item
Value: {{iterator2.current_array_item}}

Step 3: Add Additional Data (Optional)

You can still add other parameters alongside the iterator data:

Data Parameters:
Key: iterator_item
Value: {{iterator2.current_array_item}}

Key: new_data
Value: {{iso_8601_utc}}

Response Examples

Iterator Output Example

When your iterator processes an item, the current_array_item contains the complete data structure:

{
  "id": 0,
  "firstName": "Farley",
  "lastName": "Cain",
  "email": "[email protected]",
  "address": "944 Hunts Lane, Stockwell, Indiana, 3655",
  "status": "Canceled"
}

Webhook Request Body

The receiving webhook will get the exact same structure as the iterator output:

{
  "id": 0,
  "firstName": "Farley",
  "lastName": "Cain",
  "email": "[email protected]",
  "address": "944 Hunts Lane, Stockwell, Indiana, 3655",
  "status": "Canceled",
  "new_data": "2025-08-05T17:31:02+00:00"
}

Multiple Iterator Items

For each iteration, a separate webhook request is sent with the same clean structure:

First Request:

{
  "id": 0,
  "firstName": "Farley",
  "lastName": "Cain",
  "email": "[email protected]",
  "address": "944 Hunts Lane, Stockwell, Indiana, 3655",
  "status": "Canceled",
  "new_data": "2025-08-05T17:31:02+00:00"
}

Second Request:

{
  "id": 14,
  "firstName": "Priscilla",
  "lastName": "Robinson",
  "email": "[email protected]",
  "address": "504 Ridge Boulevard, Heil, Vermont, 6244",
  "status": "Waiting",
  "new_data": "2025-08-05T17:31:02+00:00"
}

Benefits

1. Identical Data Structure

  • Key Advantage: The webhook receives the exact same data structure as the iterator output
  • No Wrapper Objects: Clean, direct data transfer without nested objects
  • Seamless Integration: Perfect for passing data between FlowMattic workflows

2. Simplified Configuration

  • Before: Map 6+ individual fields
  • After: Map 1 field containing all data

3. Dynamic and Maintenance-Free

  • New fields added to source data are automatically included
  • No need to update webhook configurations when data structure changes
  • Works regardless of how your data evolves over time

4. Time Efficiency

  • Reduces setup time by up to 80%
  • Eliminates repetitive mapping tasks

5. Error Reduction

  • Less manual configuration means fewer chances for mapping errors
  • Consistent data structure across all webhook calls

Best Practices

1. Keep It Simple

The beauty of this feature is its simplicity. In most cases, you only need:

Data Parameters:
Key: iterator_item
Value: {{iterator2.current_array_item}}

2. Add Metadata When Needed

If you need additional context, add it alongside the iterator data:

Data Parameters:
Key: iterator_item
Value: {{iterator2.current_array_item}}

Key: processed_at
Value: {{iso_8601_utc}}

Key: source_workflow
Value: {{workflow.name}}

3. Test Your Configuration

Use the “Test Action” button to verify that your receiving webhook gets the expected data structure.

Troubleshooting

Common Issues

Issue: Receiving webhook doesn’t get the expected data structure
Solution: Verify that you’re using iterator_item as the key name and mapping to current_array_item

Issue: Missing fields in webhook requests
Solution: Ensure your iterator is properly configured and test the iterator output before setting up the webhook

Issue: Data not updating when source changes
Solution: This feature automatically includes new fields, so check if your iterator source is actually providing the updated data

Migration from Old Method

If you’re currently using individual field mapping, here’s how to migrate:

Before (Individual Mapping):

Data Parameters:
Key: id
Value: {{iterator2.id}}

Key: firstName  
Value: {{iterator2.firstName}}

Key: lastName
Value: {{iterator2.lastName}}

Key: email
Value: {{iterator2.email}}

Key: address
Value: {{iterator2.address}}

Key: status
Value: {{iterator2.status}}

Result: Webhook receives exactly what you mapped

{
  "id": 0,
  "firstName": "Farley",
  "lastName": "Cain",
  "email": "[email protected]",
  "address": "944 Hunts Lane, Stockwell, Indiana, 3655",
  "status": "Canceled"
}

After (Single Mapping):

Data Parameters:
Key: iterator_item
Value: {{iterator2.current_array_item}}

Result: Webhook receives the complete iterator output automatically

{
  "id": 0,
  "firstName": "Farley",
  "lastName": "Cain",
  "email": "[email protected]",
  "address": "944 Hunts Lane, Stockwell, Indiana, 3655",
  "status": "Canceled"
}

Real-World Use Cases

1. Workflow Chaining

Pass complete customer records from one workflow to another for different processing stages.

2. Data Synchronization

Send entire product catalogs item by item to external systems without worrying about field changes.

3. Notification Systems

Forward complete event data to notification workflows while maintaining all original context.

Conclusion

This new feature revolutionizes how you handle iterator data in FlowMattic workflows. By providing the exact same data structure at the receiving end, it eliminates complexity and ensures seamless data flow between workflows. Whether your data has 5 fields or 50 fields, whether it changes tomorrow or next month, your webhook configuration remains simple and reliable.

The key insight is that you no longer need to think about individual field mapping – just pass the entire iterator response with a single mapping, and FlowMattic handles the rest intelligently. This makes building robust, maintainable automation workflows faster and more intuitive than ever before.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied