DebouncePostgres
AI-generatedOverview
This node implements a debounce mechanism using a PostgreSQL database table to manage unique keys and wait times. It is useful in scenarios where you want to limit the frequency of certain operations or events by ensuring that actions associated with a unique key are only processed after a specified cooldown period. For example, it can be used to prevent duplicate processing of webhook events or to throttle API calls based on unique identifiers.
Use Case Examples
- Debouncing webhook events by storing event keys in a PostgreSQL table and only allowing processing if the cooldown period has passed.
- Throttling API requests by using a unique key and wait time to control the frequency of calls.
Properties
| Name | Meaning |
|---|---|
| Table | The PostgreSQL table name used to store debounce keys and timestamps. |
| Key | The unique key to identify the debounce entry. |
| Wait Amount | The cooldown period in seconds to wait before allowing the operation to proceed again. |
| Cooldown Logic | A boolean flag to enable or disable cooldown logic, affecting how the debounce is applied. |
Output
JSON
- `` - An empty array indicating no output data when the debounce condition is met or cooldown is active.
Dependencies
- PostgreSQL database connection with credentials including host, database, user, password, port, and SSL settings.
Troubleshooting
- Ensure the PostgreSQL credentials are correct and the database is accessible to avoid connection errors.
- Verify the specified table exists in the database and has the expected schema to prevent query failures.
- If the node returns an empty array, it means the debounce condition was not met or the cooldown logic prevented processing.
- Check the wait time and key values to ensure they are correctly set to achieve the desired debounce behavior.