Recombee AddRating
Overview
This node records explicit user ratings for items in a recommendation system. By capturing how users rate specific items, it provides strong feedback signals that help improve the accuracy of recommendation algorithms. This operation is essential for applications that want to personalize content or product suggestions based on user preferences.
Common scenarios include:
- E-commerce platforms collecting customer ratings on products.
- Media streaming services gathering user ratings on movies or songs.
- Any system where user feedback on items can enhance personalized recommendations.
For example, after a user watches a movie, this node can record their rating (e.g., 4 out of 5 stars), which the recommendation engine then uses to suggest similar movies the user might like.
Properties
| Name | Meaning |
|---|---|
| User ID | The ID of the user who provided the rating. |
| Item ID | The ID of the item being rated. |
| Cascade Create | Whether to create the item if it does not exist in the database (true/false). |
| Rating | The rating value given by the user, typically between 0 and 5. |
| Timestamp | Optional timestamp indicating when the rating was given. If omitted, the current time is used. |
| Max Retries | Number of times to retry failed batch requests, useful for handling temporary network issues or rate limits. |
| Recommendation ID | Optional ID of a recommendation; if provided, the rating will be associated with this recommendation. |
Output
The node outputs an array of JSON objects, each representing the result of adding a rating for an input item. Each output object contains:
success: Boolean indicating whether the rating was successfully recorded.- All input parameters related to the rating (
userId,itemId,rating,timestamp, etc.). data: The response data from the recommendation API if successful.error: Error message if the operation failed for that particular rating.
If multiple ratings are processed in batch, the output includes results for each rating individually.
The node does not output binary data.
Dependencies
- Requires an external recommendation service API client configured with:
- A database identifier.
- A private token for authentication.
- Region information for the service endpoint.
- Needs an API key credential configured in n8n for authenticating requests.
- Uses a utility function to convert timestamps to epoch format.
Troubleshooting
- Network or Rate Limit Errors: The node retries batch requests up to the configured "Max Retries" count. If failures persist beyond retries, errors are thrown unless "Continue On Fail" is enabled.
- Invalid Input Data: Missing required fields like User ID or Item ID will cause errors.
- Timestamp Issues: Providing an invalid timestamp format may cause conversion errors; omit the timestamp to use the current time automatically.
- Cascade Create Disabled: If the item does not exist and cascade creation is disabled, the operation may fail.
- Error Messages: Errors returned from the external API are included in the output. To resolve, verify credentials, input data correctness, and API service status.