Re-using source data and splitting multiple times throughout a workflow

Hello!

I have the following usecase.

  1. I retrieve a set data set comprising of multiple orders (header) and multiple order lines per order.

e.g.

[
  {
      "orders": [
          {
              "currency": "GBP",
              "number": "ORD123",
              "order_lines": [
                  {
                      "price": 1.5,
                      "SKU": "A"
                  },
                  {
                      "price": 2,
                      "SKU": "B"
                  },
                  {
                      "price": 11.5,
                      "SKU": "C"
                  }
              ]
          },
          {
              "currency": "EUR",
              "number": "ORD567",
              "order_lines": [
                  {
                      "price": 1.5,
                      "SKU": "A"
                  },
                  {
                      "price": 2,
                      "SKU": "B"
                  },
                  {
                      "price": 11.5,
                      "SKU": "C"
                  }
              ]
          }
      ]
  }
]

What i need to be able to do is

  1. Split the document into individual orders - Check all good
  2. For each order post the header (name, currency) to an http endpoint - Check all good
  3. Test the response for success / failure - check all good
  4. If successful, then make a separate http request for Just the lines of the order i just posted. - Issue is here. if i Add in another split, i can select the data from the output of the first split to use in my second split in the drop down, but even though there is data there i never actually get anytihng in the output.

Is this correct?

Any help would be appreciated. thanks!

  • n8n version: - Community
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): - Docker
  • Operating system: - MacOS

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

It would seem that its not possible to use data from a few steps back, is this the case / a bug?

It is possible. See Item Linking Concepts for an explanation of how it works.

What expression are you using to reference the “data from a few steps back?”

Something explicitly referencing the node name, like the following, should work: {{ $('Split Out').item.json.number }}

1 Like

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