Overview
The Tracker node's "By Name" resource with the "Decrease" operation is designed to decrement a tracked value identified by a specific name. This is useful in scenarios where you need to programmatically reduce counters, quotas, or similar numeric values stored on an external service via API calls. For example, it could be used to decrease inventory counts, usage limits, or any other decrementable metric by a specified step, ensuring the value does not fall below a defined minimum.
Properties
Name | Meaning |
---|---|
Name | The identifier for the value to be decreased. Used as /decrease/<name> in the endpoint. |
Min | The minimum value allowed after the decrease operation. Prevents the value from dropping below this threshold. |
Step | The amount by which the value should be decreased. |
Output
- The output will be a JSON object reflecting the result of the decrease operation. The exact structure depends on the API response, but typically includes the updated value and possibly status information.
- No binary data is produced by this operation.
Dependencies
- External Service: Requires access to a Tracker API endpoint.
- API Credentials: Needs
trackerApi
credentials configured in n8n, including a domain (used as the base URL). - n8n Configuration: Ensure the credential named
trackerApi
is set up with the correct domain and authentication details.
Troubleshooting
- Missing Credentials: If the
trackerApi
credential is not provided or misconfigured, the node will fail to connect to the API. - Invalid Name: Supplying a non-existent or incorrect name may result in a "not found" or similar error from the API.
- Step/Min Issues: Setting a step that would decrease the value below the minimum may cause the API to reject the request or return an error.
- Common Error Messages:
"401 Unauthorized"
: Check your API credentials."404 Not Found"
: Verify the "Name" property matches an existing tracker."400 Bad Request"
: Ensure "Step" and "Min" are valid numbers and within acceptable ranges.
Links and References
- n8n Documentation: Creating Custom Nodes
- API Authentication in n8n
- (If available) Refer to your Tracker API documentation for endpoint specifics.