'If' node causing errors further down workflow after update to 1.11.2

Describe the problem/error/question

After updating from 1.9.3. to 1.11.2, I’m getting errors on a workflow including an If node. Basically, the Nodes connected directly to the If node work as expected on all the items being processed, but any nodes further down the workflow error out with the following error: The expression uses data in the node ‘IF’ but there is more than one matching item in that node
The expression in question is referencing an id: {{ $('IF').item.json.id }}
This workflow is manually executed. I’m not sure how to reference specific items and there doesn’t seem to be anything in the documentation or automatic code completion in expressions that’s surfacing anything helpful.
After downgrading back to 1.9.3 this workflow works fine with the same exact data.

In my test workflow below, Edit Fields 1 executes successfully with multiple items but Edit Fields 2 does not.

What is the error message (if any)?

The expression uses data in the node ‘IF’ but there is more than one matching item in that node

Workflow

Information on your n8n setup

  • n8n version: 1.11.2
  • Database (default: SQLite):SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • **Operating system: Ubuntu 22.04.3 **

Hey @Josh,

Oddly for me that workflow is working if I use a fake output like…

[
  {
    "date_expires": "",
    "description": "ticket",
    "id": 1
  },
  {
    "date_expires": "",
    "description": "ticket",
    "id": 2
  },
  {
    "date_expires": "aaa",
    "description": "ticket",
    "id": 3
  }
]

I have tested this on 1.11.2 and 1.14.2, Are you able to share the output data from the http request node so I can see if I can reproduce it with that?

Hi @Jon,

Thanks for taking a look.
Here’s (sanitized) actual data from the HTTP Request Node:

[
  {
    "id": 107620,
    "code": "xx",
    "amount": "100.00",
    "status": "publish",
    "date_created": "2023-10-26T12:33:24",
    "date_created_gmt": "2023-10-26T10:33:24",
    "date_modified": "2023-10-26T12:33:24",
    "date_modified_gmt": "2023-10-26T10:33:24",
    "discount_type": "percent",
    "usage_count": 0,
    "individual_use": false,
    "product_ids": [],
    "excluded_product_ids": [],
    "description": "student ticket",
    "usage_limit": null,
    "usage_limit_per_user": null,
    "limit_usage_to_x_items": 1,
    "free_shipping": false,
    "product_categories": [
      121
    ],
    "excluded_product_categories": [
      242
    ],
    "exclude_sale_items": false,
    "minimum_amount": "0.00",
    "maximum_amount": "0.00",
    "email_restrictions": [
      "[email protected]"
    ],
    "used_by": [],
    "meta_data": [],
    "_links": {
      "self": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons/107620"
        }
      ],
      "collection": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons"
        }
      ]
    }
  },
  {
    "id": 107619,
    "code": "xx",
    "amount": "100.00",
    "status": "publish",
    "date_created": "2023-10-26T12:33:08",
    "date_created_gmt": "2023-10-26T10:33:08",
    "date_modified": "2023-10-26T12:33:08",
    "date_modified_gmt": "2023-10-26T10:33:08",
    "discount_type": "percent",
    "usage_count": 0,
    "individual_use": false,
    "product_ids": [],
    "excluded_product_ids": [],
    "description": "student ticket",
    "usage_limit": null,
    "usage_limit_per_user": null,
    "limit_usage_to_x_items": 1,
    "free_shipping": false,
    "product_categories": [
      121
    ],
    "excluded_product_categories": [
      242
    ],
    "exclude_sale_items": false,
    "minimum_amount": "0.00",
    "maximum_amount": "0.00",
    "email_restrictions": [
      "[email protected]"
    ],
    "used_by": [],
    "meta_data": [],
    "_links": {
      "self": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons/107619"
        }
      ],
      "collection": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons"
        }
      ]
    }
  },
  {
    "id": 107618,
    "code": "xx",
    "amount": "100.00",
    "status": "publish",
    "date_created": "2023-10-26T12:32:58",
    "date_created_gmt": "2023-10-26T10:32:58",
    "date_modified": "2023-10-26T12:32:58",
    "date_modified_gmt": "2023-10-26T10:32:58",
    "discount_type": "percent",
    "usage_count": 0,
    "individual_use": false,
    "product_ids": [],
    "excluded_product_ids": [],
    "description": "student ticket",
    "usage_limit": null,
    "usage_limit_per_user": null,
    "limit_usage_to_x_items": 1,
    "free_shipping": false,
    "product_categories": [
      121
    ],
    "excluded_product_categories": [
      242
    ],
    "exclude_sale_items": false,
    "minimum_amount": "0.00",
    "maximum_amount": "0.00",
    "email_restrictions": [
      "[email protected]"
    ],
    "used_by": [],
    "meta_data": [],
    "_links": {
      "self": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons/107618"
        }
      ],
      "collection": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons"
        }
      ]
    }
  },
  {
    "id": 107617,
    "code": "xx",
    "amount": "100.00",
    "status": "publish",
    "date_created": "2023-10-26T12:32:48",
    "date_created_gmt": "2023-10-26T10:32:48",
    "date_modified": "2023-10-26T12:32:48",
    "date_modified_gmt": "2023-10-26T10:32:48",
    "discount_type": "percent",
    "usage_count": 0,
    "individual_use": false,
    "description": "student ticket",
    "product_ids": [],
    "excluded_product_ids": [],
    "usage_limit": null,
    "usage_limit_per_user": null,
    "limit_usage_to_x_items": 1,
    "free_shipping": false,
    "product_categories": [
      121
    ],
    "excluded_product_categories": [
      242
    ],
    "exclude_sale_items": false,
    "minimum_amount": "0.00",
    "maximum_amount": "0.00",
    "email_restrictions": [
      "[email protected]"
    ],
    "used_by": [],
    "meta_data": [],
    "_links": {
      "self": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons/107617"
        }
      ],
      "collection": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons"
        }
      ]
    }
  },
  {
    "id": 107616,
    "code": "xx",
    "amount": "100.00",
    "status": "publish",
    "date_created": "2023-10-26T12:32:37",
    "date_created_gmt": "2023-10-26T10:32:37",
    "date_modified": "2023-10-26T12:32:37",
    "date_modified_gmt": "2023-10-26T10:32:37",
    "discount_type": "percent",
    "usage_count": 0,
    "individual_use": false,
    "product_ids": [],
    "excluded_product_ids": [],
    "description": "student ticket",
    "usage_limit": null,
    "usage_limit_per_user": null,
    "limit_usage_to_x_items": 1,
    "free_shipping": false,
    "product_categories": [
      121
    ],
    "excluded_product_categories": [
      242
    ],
    "exclude_sale_items": false,
    "minimum_amount": "0.00",
    "maximum_amount": "0.00",
    "email_restrictions": [
      "[email protected]"
    ],
    "used_by": [],
    "meta_data": [],
    "_links": {
      "self": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons/107616"
        }
      ],
      "collection": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons"
        }
      ]
    }
  },
  {
    "id": 107615,
    "code": "xx",
    "amount": "100.00",
    "status": "publish",
    "date_created": "2023-10-26T12:32:27",
    "date_created_gmt": "2023-10-26T10:32:27",
    "date_modified": "2023-10-26T12:32:27",
    "date_modified_gmt": "2023-10-26T10:32:27",
    "discount_type": "percent",
    "usage_count": 0,
    "individual_use": false,
    "product_ids": [],
    "description": "student ticket",
    "excluded_product_ids": [],
    "usage_limit": null,
    "usage_limit_per_user": null,
    "limit_usage_to_x_items": 1,
    "free_shipping": false,
    "product_categories": [
      121
    ],
    "excluded_product_categories": [
      242
    ],
    "exclude_sale_items": false,
    "minimum_amount": "0.00",
    "maximum_amount": "0.00",
    "email_restrictions": [
      "[email protected]"
    ],
    "used_by": [],
    "meta_data": [],
    "_links": {
      "self": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons/107615"
        }
      ],
      "collection": [
        {
          "href": "https://www.***.com/wp-json/wc/v3/coupons"
        }
      ]
    }
  }]

I’ve realized that I simplified the sample workflow I sent along here too much (apologies). There’s actually a MySQL Node in there and when that’s in the way, the Nodes further along the workflow trying to grab data from the If Node error out, even though the number and order of Items doesn’t change.
Workflow without MySQL Node:


With MySQL Node:

Detail of error:

Here’s the workflow causing the error:

Both sample workflows (with and without MySQL) work fine on 1.9.3.

Thanks in advance for looking into this.

EDIT: (data from the MySQL Node):

[
  {
    "student_ticket_exp": "2023-12-17"
  },
  {
    "student_ticket_exp": "2023-12-17"
  },
  {
    "student_ticket_exp": "2023-12-17"
  },
  {
    "student_ticket_exp": "2023-12-17"
  },
  {
    "student_ticket_exp": "2023-12-17"
  },
  {
    "student_ticket_exp": "2023-12-17"
  }
]

Hey @Josh,

The good news is I have managed to reproduce it, It wasn’t doing it with pinned data so I had to rebuild that part of your database to run the query and that outputs the message.

I suspect the issue will be with the paired item output not being set correctly, I will get a dev created for this shortly so we can look at getting this fixed.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

New version [email protected] got released which includes the GitHub PR 8940.