Expert workflow: advanced rules by product, category, and lists

In this article, you will learn how to build workflows that analyze in detail the content of a transaction, working with product lists to apply very precise rules by:

  • Specific product (SKU / ID)

  • Category

  • Brand

  • Product combinations

  • Quantities

This type of workflow is key for retail, eCommerce, and complex promotions.

What problem does this type of workflow solve

Simple rules often fail when:

  • A purchase includes multiple products

  • Only some should generate bonuses

  • The incentive depends on the combination of items

This is where loops and conditions per item come into play.

Workflow objective

Execute actions only if one or several products in a transaction meet a specific condition.

Real examples:

  • Bonus if there is at least one “premium” product

  • Multiplier only on products from a category

  • Extra points if 2 or more units of an SKU are purchased

  • Incentives for combos (product A + product B)

Step 1 – Create the workflow

  1. Access Workflows

  2. Create a new one

  3. Suggested name:
    “Advanced rules by product and category”

Step 2 – Trigger

Select:

Points Added

This trigger exposes:

  • items → list of products

  • Price, quantity, and categories per product

Step 3 – Loop “For each item in list”

Add a step:

🔁 For each item in list

  • List: items

This will make the workflow execute item by item.

Step 4 – Conditions per product

Within the loop, add a Condition.

Example A – Specific product

  • Value 1: item.id

  • Operator: Equal to

  • Value 2: SKU_123

👉 Allows detecting an exact product.

Example B – Category

  • Value 1: item.categories

  • Operator: Contains

  • Value 2: Electronics

👉 Ideal for promotions by product family.

Example C – Minimum quantity

  • Value 1: item.quantity

  • Operator: Greater than or equal to

  • Value 2: 2

👉 Allows incentivizing bulk purchases.

Step 5 – Actions within the loop

When the condition is true, you can apply:

Common actions

  • Multiply points
    Only for that product

  • Add fixed points

  • Accumulate value in a variable

  • Set internal flags

Example:

If the product belongs to the “Electronics” category, multiply points by 2.

Step 6 – Avoid duplicates

A common mistake is to apply the action multiple times if there are several products that meet the condition.

Common solutions

✔ Use a boolean variable
✔ Exit the loop after the first match
✔ Accumulate and apply action outside the loop

This pattern will be clearer in the next article.

Complete practical case

Example

If the purchase contains at least one “Premium” product, multiply all points by 2.

Correct approach

  1. Loop over items

  2. If item.category = Premium

  3. Set flag premium_detected = true

  4. Outside the loop:

    • If flag = true → multiply points

👉 This way you avoid applying the multiplier multiple times.

Real use cases

  • Incentives for launches

  • Promotions by brand

  • Cross-selling

  • Margin control

  • B2B rules by catalog

Best practices

✔ Do not apply final actions inside the loop
✔ Use variables for control
✔ Test with mixed purchases
✔ Document the workflow objective

Was this article helpful?

Loyalty Master

Tu asistente experto en fidelización

¡Hola! Soy Loyalty Master, tu asistente experto en programas de fidelización.

Puedo ayudarte con:

  • Dudas sobre Omniwallet y sus funcionalidades
  • Configuración de tu programa de puntos
  • Estrategias de fidelización
  • Integraciones y aspectos técnicos

¿En qué puedo ayudarte hoy?

🇬🇧 View in English?