N8N Tools - Botpress API icon

N8N Tools - Botpress API

Complete Botpress integration - Enterprise conversational AI with advanced NLP

Overview

This node integrates with the Botpress conversational AI platform, specifically enabling management of conversation states. The "Get State" operation retrieves the current state variables associated with a specific conversation. This is useful for scenarios where you want to inspect or use the stored context or variables of a conversation to make decisions, trigger actions, or analyze conversation flow.

Practical examples include:

  • Fetching user session data to personalize responses.
  • Retrieving conversation context before sending a message or triggering an event.
  • Debugging or monitoring conversation states during bot development or in production.

Properties

Name Meaning
Conversation ID The unique identifier of the conversation whose state you want to retrieve (required).
Additional Fields A collection of optional fields that can be added but are not used in the "Get State" operation.

The "Additional Fields" collection includes options like Tags, Integration Channel, User Name, User Picture URL, Metadata, State Variables, Event Type, Event Payload, Quick Replies, Actions, Limit, and Page Token. However, for the "Get State" operation, these additional fields are not utilized.

Output

The output JSON contains the response from the Botpress API endpoint /v1/chat/conversations/{conversationId}/state. This typically includes the current state variables and any other relevant state information stored for the specified conversation.

The structure depends on the Botpress API but generally will be a JSON object representing the conversation's state data.

No binary data output is produced by this operation.

Example output snippet (conceptual):

{
  "userId": "12345",
  "variables": {
    "lastQuestion": "What is your name?",
    "score": 42,
    "preferences": {
      "language": "en"
    }
  },
  "metadata": { ... }
}

Dependencies

  • Requires an API key credential and access token for authenticating with the Botpress API.
  • Needs the Botpress API base URL configured.
  • Requires the Botpress bot ID to specify which bot's conversation state to access.
  • Optionally uses an integration ID if working within a specific integration channel.

These credentials and configuration must be set up in n8n prior to using this node.

Troubleshooting

  • Common issues:

    • Invalid or missing Conversation ID will cause the API call to fail.
    • Incorrect or expired API tokens will result in authentication errors.
    • Network connectivity problems may prevent reaching the Botpress API endpoint.
    • Using the wrong bot ID or integration ID can lead to "not found" or permission errors.
  • Error messages:

    • "Unknown state operation: getState": Indicates the operation parameter is incorrect or unsupported.
    • Authentication errors such as "Unauthorized" or "Forbidden" suggest invalid credentials.
    • "Conversation not found" means the provided Conversation ID does not exist or is inaccessible.
  • Resolutions:

    • Verify the Conversation ID is correct and exists in the Botpress system.
    • Ensure API keys and tokens are valid and have necessary permissions.
    • Check network settings and Botpress API availability.
    • Confirm the bot ID and integration ID are correctly configured.

Links and References

Discussion