Hi, wondering if anyone could help. Since there’s no trigger for airtable, I’m trying to create some logic to simulate one: I take the latest added row to an airtable table compare its ID to previously processed item, if it’s the same, it stops the flow else it progresses in the flow.
Polling is never not the best thing. For Google Sheets, I think it would be possible to build a proper Trigger-Node. For Airtable does it not seem like it though. When I looked I was not able to find anything to do that. So I guess polling it is.
If it does not execute to often (like if it would never overlap) and the data is not too large (like you said just an id) it would be possible to use static workflow data. With that, it is possible to save data with the workflow. Does, for example, get used for the Github-Trigger Node to save the webhook id. Looks like this:
There are however two problems right now.
That method is not exposed in the Function-Node. That is, however, an easy fix and takes two minutes.
There seems to be a bug that the data does not get saved correctly when executing multiple times (like when triggered via Interval node or similar). No idea how much work that would be.
Normally I would try to fix it now asap but sadly things are still a little bit crazy from the launch and I am just answering emails, issues and community questions all day long. So do not know when I find time to look into that. Sorry!
An alternative would be to use the Postgres node to persist the value there. Or simply saving a file would also be possible.
Ok in the latest n8n version (0.25.1) the bug got now fixed. Also, do the function nodes now have access to the static data.
Here a basic counter-example:
Be aware that the static data does not get persisted when testing via the Editor-UI. Only if it is in production mode will the static data be persisted and it will count up.
I made a version of this that is really horrible! But it does work. Basically I have a Google sheet connected to a form (INPUT), and another tab in the sheet that serves as a log (LOG). As submissions from the form come into the sheet, n8n checks both tabs and adds an boolean attribute “fromLOG” depending on which tab it came from. A merge node combines them and overwrites all ‘false’ values from the INPUT tab as ‘true’ if they already exist in LOG. Then a function node filters out so only rows that were unique to the INPUT tab pass through.