How to retrieve only new records?

To make this generic, and because you can’t control the returned data, you’d need to use workflow static data.

In this example, we get the last comment ID lastId from static data (or set to 0), the IF node then compares the IDs from the HTTP request to see if they’re greater than the lastId and acts accordingly. Finally it updates the static data lastId. For demo sake it uses a _limit parameter to limit how many results are returned, which is always lastId + 5 so we get new data each run. This way when you set the workflow to active, you’ll see how it functions with new data. Note: staticData does not work in testing mode, it only works on active workflows.

If you’d like this to be easier to access, like in expressions then pop a vote on this issue - Make workflow static data accessible

Second run:

8th run:

Workflow JSON.

2 Likes