Filter Data by Condition in n8n
When processing data, you often need to narrow down results to only the items that matter. Maybe you want to find high-value orders, active users, or products that meet specific criteria.
The Filter node evaluates each item against conditions you define. Items that pass the conditions continue through the workflow. Items that fail are discarded.
In this challenge, you will filter products to find only those worth featuring - items that are both affordable and highly rated.
What you'll practice:
- Using the Filter node to keep only matching items
- Setting up multiple conditions with AND logic
- Understanding how non-matching items are discarded
Your Task
- 1Copy the exercise below
- 2Paste into your n8n editor (Ctrl+V)
- 3Solve it — use hints if you get stuck
- 4Check the solution when done
Fetch products from https://dummyjson.com/products?limit=10 and filter them to find "featured deals" - products that meet BOTH of these criteria:
- Price is less than 20
- Rating is greater than or equal to 4
Example product structure:
{
"id": 1,
"title": "Essence Mascara Lash Princess",
"price": 9.99,
"rating": 4.94,
"category": "beauty"
}
Expected result: Only products meeting both criteria pass through. All other products are discarded.
Get the exercise workflow
Create a free account to copy exercises into your n8n editor.