Actions6
- User Actions
- Activity Actions
- Message Actions
Overview
This node interacts with a Coach API to retrieve or update activity-related data for users. Specifically, the "Get Current KPI Value" operation fetches the current Key Performance Indicator (KPI) value for a given user based on optional filters like activity date and activity ID. This is useful in scenarios where you want to monitor or analyze a user's performance metrics tied to specific activities or dates.
Practical examples:
- Fetching the latest KPI value for a sales representative on a particular day.
- Retrieving KPI values related to a specific training activity for a user.
- Integrating KPI data into dashboards or reports for performance tracking.
Properties
| Name | Meaning |
|---|---|
| User ID | ID of the user to get data for (required). |
| Activity Date | Optional date filter to specify the activity date for which to get the current KPI data. |
| Activity ID | Optional identifier of the activity to filter the KPI data retrieval. |
Output
The node outputs an array of JSON objects, each representing the response from the Coach API for the requested operation. For the "Get Current KPI Value" operation, the json output contains the KPI data retrieved from the API, typically including fields such as KPI values, timestamps, and related metadata.
No binary data output is involved in this operation.
Example output structure (simplified):
{
"kpiValue": "...",
"activityId": "...",
"activityDate": "...",
"userId": "..."
}
Dependencies
- Requires an API key credential and company ID credential to authenticate requests to the Coach API.
- The node makes HTTP POST requests to the endpoint:
https://dev.mymatrixapp.com/crmApi/get-current-kpi-value. - Proper configuration of these credentials within n8n is necessary for successful API communication.
Troubleshooting
Common issues:
- Missing or invalid API credentials will cause authentication failures.
- Providing an incorrect or non-existent user ID may result in empty or error responses.
- Incorrect formatting of optional parameters like activity date might lead to unexpected results.
Error messages:
- Authentication errors usually indicate missing or wrong API keys/company IDs; verify credentials.
- API response errors may include messages about invalid parameters; ensure that user ID is provided and optional fields are correctly formatted.
- Network errors could occur if the API endpoint is unreachable; check network connectivity and endpoint URL.
Links and References
- Coach API Documentation (assumed, replace with actual link if available)
- n8n HTTP Request Node documentation for understanding request routing and authentication setup: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/