npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

n8n-nodes-iterator

v0.1.2

Published

This node allows you to add a simple to use iterator inside your workflow. Especially helpful to use with paging API requests.

Downloads

34

Readme

Banner image

n8n-nodes-iterator

The iterator node can be used for paging HTTP requests. There is 2 main options for this.

Usage

The node can be a fit funky to setup some times, this because of the flexibility of it. If you cannot figure it out or have questions please open a topic on the n8n community for help.

Reference Next

This can be used if the API has a response which also tells you what the next page is. It can also be used with APIs which only give a "next cursor" for example, you will simply need to use that as part of the string in an expression.

Next

You can use the "currentReference" as the value in the HTTP node. So in this case it is the full URL. currentRef

This will automatically be filled with the correct value, when you setup the Iterator node correctly. The Reference Start is the first page it needs to retrieve.

setupNext

An expression is used in the Reference Next, to get the next page for every iteration: httpNext

When there is no next page left it will end the loop.

Auto Increment

The auto increment is for manual iteration through the different pages. This is usually simply a page number so from 1,2,3 etc. But it can also be an offset that needs to be set.

  • If it is normal pages, set the increment size to 1 to retrieve all pages.
  • If the API is using an offset set it to the size of the page to let it loop through all pages.

increment

The "Expected Item Count" is used to make sure it will stop at some point. This is the page size you need to fill in here. Whenever you are getting les records than the pagesize it will end the loop. The default value is 50, so if no value is set it will stop when less than 50 are returned.

The HTTP node will look something like this for this example:

incrementHTTP

currentIncrement

General options and (hidden)features

options

  • Option Combine: This boolean will determine if the iterated output will be combined in the end.

  • Option Limit: The limit will limit the amount of records returned in the end. This is especially useful when the Combine boolean is set to true.

  • Option Is There Another Page: This is a boolean which can be set to end the loop when ever you need it to. This can be set with an expression to have complete control over the ending of the loop. Can also be used if an API does not have the next reference but does have a flag telling you it the last page, or if you want to use the count of all record to let it decide when to stop.

  • only 1 item is send into the loop to make sure you are not accidentally querying an API multiple times with the same request. This will always be the last item. When the Loop ends, the Done path will contain the items of the last iteration or the combined set of items.

Installation

Follow the installation guide in the n8n community nodes documentation.

Compatibility

This node was developed and tested in version 0.193.3.

Resources

License

MIT