Skip to content

Commit

Permalink
feat: added "Throttle" node
Browse files Browse the repository at this point in the history
  • Loading branch information
umanamente committed Apr 20, 2023
1 parent 6b84212 commit 433c816
Show file tree
Hide file tree
Showing 16 changed files with 18,768 additions and 7,929 deletions.
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2.1

jobs:
build:
docker:
- image: node:latest
steps:
- checkout
- run: npm install
- run: npm run prepublishOnly
- persist_to_workspace:
root: ~/project
paths:
- .

semantic-release:
docker:
- image: node:latest
steps:
- attach_workspace:
at: "~/project"
- run: npm run semantic-release

workflows:
version: 2
build:
jobs:
- build
- semantic-release:
requires:
- build
64 changes: 31 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)
# <img src="nodes/Throttle/filter.svg" height="40px" /> n8n-nodes-throttle

# n8n-nodes-starter
This is an n8n community node. It lets you to throttle the execution of workflows.

This repo contains example nodes to help you get started building your own custom integrations for [n8n](n8n.io). It includes the node linter and other dependencies.
It provides a `Throttle` note that routes items either to the `Allowed` or `Blocked` output depending on the configured throttling timeout.

To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry).
> **Note:** This node will only block executions if workflow is triggered by a webhook or any other automated trigger.
It will allow all executions if the workflow is triggered manually.
This is due to N8N internal restrictions.

## Prerequisites
## Table of Contents

You need the following installed on your development machine:
* [Use cases](#use-cases)
* [Installation](#installation)
* [Operations](#operations)
* [Usage](#usage)
* [Version history](CHANGELOG.md)

* [git](https://git-scm.com/downloads)
* Node.js and npm. Minimum version Node 16. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows).
* Install n8n with:
```
npm install n8n -g
```
* Recommended: follow n8n's guide to [set up your development environment](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/).

## Use cases

## Using this starter
It could be combined with `Wait` node to retry the execution of the workflow after some time:

These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the [documentation](https://docs.n8n.io/integrations/creating-nodes/).
![Use case: wait](docs/images/use_cases/use_case_wait.png)

1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository.
2. Clone your new repo:
```
git clone https://github.com/<your organization>/<your-repo-name>.git
```
3. Run `npm i` to install dependencies.
4. Open the project in your editor.
5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes.
6. Update the `package.json` to match your details.
7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible.
8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance.
9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started.
10. Update the LICENSE file to use your details.
11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm.
Or it could be combided with `Error` node to terminate the workflow execution.

## More information
![Use case: terminate](docs/images/use_cases/use_case_terminate.png)

Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes.

## License
## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

## Operations

_List the operations supported by your node._

## Usage

_This is an optional section. Use it to help users with any difficult or confusing aspects of the node._

_By the time users are looking for community nodes, they probably already know n8n basics. But if you expect new users, you can link to the [Try it out](https://docs.n8n.io/try-it-out/) documentation to help them get started._


[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md)
48 changes: 0 additions & 48 deletions README_TEMPLATE.md

This file was deleted.

56 changes: 0 additions & 56 deletions credentials/ExampleCredentialsApi.credentials.ts

This file was deleted.

47 changes: 0 additions & 47 deletions credentials/HttpBinApi.credentials.ts

This file was deleted.

Binary file added docs/images/use_cases/use_case_terminate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/use_cases/use_case_wait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 0 additions & 76 deletions nodes/ExampleNode/ExampleNode.node.ts

This file was deleted.

18 changes: 0 additions & 18 deletions nodes/HttpBin/HttpBin.node.json

This file was deleted.

Loading

0 comments on commit 433c816

Please sign in to comment.