Split Out, Filter, then Aggregate

Hello,

I’m new to n8n and I’m having hard time making a workflow for this use case.

  1. Http request to retrieve a list of invoices
  2. Split Out the list of invoices
  3. For each invoices, make a SQL query to retrieve if this invoice was already sent.
  4. Filters out invoices that are already sent
  5. Http request to send the list of invoices not already sent

The issue I am having is between steps 4 and 5, I need to aggregate the list of invoices. However, step 3 (SQL) has transformed the output into a simple list with only 2 columns: InvoiceNumber and Sent. In step 5, I need to send the filtered list of original json objects retreived in step 1.

So basically if I try to generalise my question, I would ask: how to filter a list based on a condition result retrieved using an external call on each items(sql, http,…), and output the original objects from the list ?

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:

hello @guillaumemorin

you can use a special syntax in the second HTTP Requests node like $('Split Out').item.json.whatever_field_you_need

More details are there
Output of other nodes | n8n Docs

1 Like

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