itemMatching() Usage Example for Data Linking in n8n
This workflow demonstrates using itemMatching() in a Code node to link and retrieve data from earlier nodes by index, enriching output with details like emails after filtering.
This n8n workflow serves as a practical tutorial on the itemMatching(itemIndex: Number) function within a Code node. It starts with a Manual Trigger, fetches a list of customers from the 'Customer Datastore (n8n training)' node, then uses an 'Edit Fields' node to reduce the data to just names, simulating a filtering step. Finally, a Python Code node iterates over the filtered items, employing itemMatching(i) to reference the original customer data by index and append the 'restoreEmail' field with the matching email.
The key benefit is enabling precise data cross-referencing in multi-branch or filtered workflows where direct JSON access fails due to mismatched item counts. This prevents data loss during transformations, saving time on complex automations. Sticky notes provide clear guidance on generating and reducing data.
Ideal use cases include data enrichment pipelines, such as matching user lists to profiles, restoring metadata after aggregations, or linking subsets in CRM/ERP integrations. Developers and n8n users can adapt this for custom matching logic in production workflows, enhancing reliability without external tools.
New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.
Related bundle
YouTube Creator Pipeline
8 hand-picked workflows for $39.00.
That is $4.88 each, vs $6.99 for this one alone.
View bundleSecure checkout powered by Stripe
Support
How to import this workflow into n8n
- 1Purchase or download the workflow to get the n8n workflow JSON file.
- 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
- 3Open each node marked with a credential warning and connect your own accounts and API keys.
- 4Run the workflow once manually to verify the data flow, then toggle it to Active.
Related Miscellaneous workflows
- Get notified about Notion updates via Gmail$3.99
- Analyze and audit website SEO$2.99
- 🌸 CFO Sunrise: Morning Brief for Household CEOs$14.99
- Markdown Timesheet Report Generator$9.99
- Venafi TLS Protect Cloud MCP Server: All 8 Cert Operations$24.99
- Track Hourly Weather Conditions with OpenWeatherMap and Google Sheets$9.99
More from Matt Buds
Need this deployed? We'll set it up for you.
Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.