N8N Tools - Botpress API icon

N8N Tools - Botpress API

Complete Botpress integration - Enterprise conversational AI with advanced NLP

Overview

The node provides integration with Botpress, an enterprise conversational AI platform. Specifically, the Get Bot Statistics operation under the Bot resource retrieves usage statistics for a configured bot. This can be useful for monitoring bot performance, understanding user engagement, and analyzing conversation metrics.

Typical use cases include:

  • Tracking how many users interact with the bot over time.
  • Measuring message volumes or session counts.
  • Gathering insights to optimize bot behavior or content.

For example, a customer support team might use this node to fetch daily bot usage stats to evaluate if the bot is effectively handling inquiries or if adjustments are needed.

Properties

Name Meaning
Additional Fields Optional parameters to customize the request. Includes:
- Tags Comma-separated list of tags to filter or categorize data (not used in this operation).
- Integration Channel Name of the integration channel (e.g., telegram, slack) (not used here).
- User Name Display name for the user (not used here).
- User Picture URL Profile picture URL for the user (not used here).
- Metadata Additional metadata as JSON (not used here).
- State Variables State variables as JSON object (not used here).
- Event Type Type of event to create (not used here).
- Event Payload Event payload as JSON (not used here).
- Quick Replies Comma-separated list of quick reply options (not used here).
- Actions Card/message actions as JSON array (not used here).
- Limit Maximum number of results to return (not used here).
- Page Token Token for pagination (not used here).

Note: For the Get Bot Statistics operation, none of the additional fields appear to affect the API call directly; it simply performs a GET request to retrieve statistics.

Output

The output is a JSON object containing the bot's usage statistics as returned by the Botpress API endpoint /v1/admin/bots/{botId}/stats.

The exact structure depends on the Botpress API response but typically includes metrics such as:

  • Number of active users
  • Total conversations
  • Message counts
  • Other relevant usage analytics

No binary data is produced by this operation.

Example output snippet (illustrative):

{
  "activeUsers": 123,
  "totalConversations": 456,
  "messagesSent": 7890,
  "timeRange": {
    "start": "2024-01-01T00:00:00Z",
    "end": "2024-01-31T23:59:59Z"
  }
}

Dependencies

  • Requires an API key credential for authenticating with the Botpress API.
  • The node expects configuration of:
    • Botpress API base URL.
    • Access token (Bearer token).
    • Bot ID to specify which bot's statistics to retrieve.
  • Optionally, an integration ID may be set for requests involving integrations.

These credentials and settings must be configured in n8n prior to using the node.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect bot ID will result in "bot not found" or similar errors.
    • Network connectivity problems can cause request timeouts or failures.
  • Error messages:

    • "Unknown bot operation: getBotStats" — indicates a misconfiguration or typo in the operation parameter.
    • HTTP 401 Unauthorized — check that the API key and access token are valid and have sufficient permissions.
    • HTTP 404 Not Found — verify the bot ID is correct and the bot exists in the Botpress instance.
  • Resolution tips:

    • Double-check all credential values and bot identifiers.
    • Ensure the Botpress server URL is reachable from the n8n environment.
    • Review Botpress API documentation for any changes in endpoints or required scopes.

Links and References

Discussion