Coze icon

Coze

Interact with Coze AI platform

Overview

This node integrates with the Coze AI platform, enabling users to manage and interact with chat conversations among other resources. Specifically, the "取消进行中的对话" (Cancel Ongoing Conversation) operation under the Chat resource allows users to cancel or terminate an active chat session identified by a chat ID. This is useful in scenarios where a conversation needs to be stopped prematurely, such as when the user wants to abort a bot interaction or reset the chat state.

Practical examples include:

  • Stopping a chatbot response generation that is taking too long.
  • Canceling a mistakenly started conversation.
  • Managing chat sessions programmatically by terminating them based on certain conditions.

Properties

Name Meaning
Authentication Method of authentication to use: either "Service Token" or "OAuth2".
会话 ID(conversationId) Optional identifier specifying which session the conversation belongs to. Used in multiple chat operations including cancel.
对话 ID(chatId) Required unique identifier of the chat conversation to be canceled.

Output

The node outputs JSON data representing the result of the cancellation request. The exact structure depends on the Coze API response but typically includes status information about whether the cancellation was successful.

If the node supports binary data output for other operations, it is not relevant here since canceling a conversation is a control action and does not produce binary content.

Dependencies

  • Requires access to the Coze AI platform API at https://api.coze.cn.
  • Needs either a service token credential or OAuth2 credential configured in n8n for authentication.
  • The node uses standard HTTP requests with JSON payloads and expects JSON responses.

Troubleshooting

  • Common issues:

    • Invalid or missing chatId will cause the cancellation to fail.
    • Authentication errors if credentials are incorrect or expired.
    • Network connectivity problems reaching the Coze API endpoint.
  • Error messages:

    • "chatId is required": Ensure the chat ID parameter is provided.
    • Authentication failures: Verify that the API key or OAuth2 token is valid and has necessary permissions.
    • API errors from Coze may include rate limiting or invalid session states; consult Coze API documentation for specific error codes.

Links and References

Discussion