Hey all. I am new to N8N but have some experience with make.com. I am bringing over my workflows from make to N8N; this workflow got me stumped. In make we have a “search” node for Airtable.
I am searching Airtable for a user ID.
I then check to see if that ID has been scraped. If YES, the second path will run an HTTP request to extract said user’s followers.
I then want to take those followers and add them to supabase so I can sort and query them later in the flow.
I am stuck with how to search supabase (or airtable) to ensure I am not adding duplicate records.
What is the best way to approach this? I have tried to “set” the ID at the start of the flow to reference later, but even with the merge node, I can never get the output of a node to output 2 inputs. Allowing me to pass the userid along the flow.
I have limited JS knowledge but I am learning. I have attempted the code node with no prevail.
Such an operation is a bit tricky indeed. Unfortunately I don’t quite know how your data structures look like, so can’t provide a direct answer for your exact use cases.
In general, there are however two different approaches I can think of. The first one would be the use of a Merge node comparing two different branches:
This example setup only lets the items pass that exist in the upper branch, but not in the lower branch.
The second approach would be the use of a “contains” comparison, but this would require a bit of JMESPath which can become hard to read. I’ve elaborated a bit on the general idea over in this thread, and here is an example workflow using the same sample data as above:
Hope this helps! Please do let me know if you have any questions on the above.
@MutedJam thank you! Super excited to be here. Coming from integromat I am super excited with what N8N can do. It’s just a learning curve.
So I tired to use the merge node but I must have been doing something wrong. Input 1 would have 100 pieces of data enter and input 2 would have 1. I would run the flow, the output of the merge node would say 101 outputs but I could never find the single input even though it was showing that it had gone through.
On this note. Is this the best way to handle this type of flow where I need to search specific entries inside supabase and update?
I am happy to show my database config if that helps. This is a very common process for me. In integromat it is costing me 1000s to do this, I am very interested in finding a more scalable solution.
So I tired to use the merge node but I must have been doing something wrong. Input 1 would have 100 pieces of data enter and input 2 would have 1. I would run the flow, the output of the merge node would say 101 outputs but I could never find the single input even though it was showing that it had gone through.
Hi @Zac_Magee, sorry this isn’t working for you just yet. I suspect this could be mostly a problem with setting up the Merge node itself though, so we can hopefully sort this out.
Can you share the JSON data your sending to each of the inputs of your Merge node as well as your current Merge node itself? You can simply select it on your n8n canvas, hit Ctrl+C to copy it, and then use Ctrl+V here on the forum to post it.
I wanted to ensure I tried everything before I replied, so here we go.
I made some progress and tried a few different things.
Here is the current workflow.
I had the merge node set incorrectly before. I was trying to output 2 fields with the same name, “user_id”.
Now I can access the record ID I wish to update at the end of the flow and link together. But now I can not work out how to link the follower record to the source account in the “linked record” field in Airtable. Creating a relation.
At the end of the flow, I wish to either create a new follower record or, if a follower exists at the IF node, link that follower to the source account.
Hi @Zac_Magee, I am not quite sure I fully understand your workflow and seeing I don’t have access to your Airtable account I won’t be able to run it on my side.
However, it looks like you’re using the “Append” mode on your Merge node here This would create a combined larger list of items based on both sources rather than comparing the elements from two different sources. Based on the incoming branches I suspect this isn’t the comparison I originally understood you wanted to do.
I can never get the output of a node to output 2 inputs. Allowing me to pass the userid along the flow.
Do you simply want to combine two items into one? If so, you would need to use the Combine mode instead:
This is similar to the filtering approach suggested in my first message, but you could simply pick the Merge By Position mode in your scenario.
I have solved the issue in my first question. This progressed me further on just to run into another gap in my knowledge within n8n.
How can I search the database ( Airtable) for the record ID at the start of my flow? In Make, there is an Airtable “search” node. Without having this node in n8n, how best can I do this?
So searching in Airtable using n8n is also possible, but that’s a bit hidden. You’d need the List operation of the regular Airtable node and can then add the Filter By Formula option.
For example, assuming this is your Airtable table: