ZAppwrite icon

ZAppwrite

Use Appwrite's API from inside N8N, updated by @ZachHandley

Overview

The "Update Topic" operation in the Messaging resource allows users to modify an existing messaging topic within the Appwrite platform. This operation is useful when you need to change the name or subscription settings of a topic that is used for sending messages such as emails, push notifications, or SMS to subscribers.

Common scenarios include:

  • Renaming a topic to better reflect its purpose.
  • Changing whether the topic supports subscriptions (enabling or disabling subscribers).
  • Managing topics dynamically in workflows where messaging topics evolve over time.

For example, if you have a topic named "Weekly Newsletter" and want to update it to "Monthly Newsletter" or toggle subscription availability, this operation facilitates those changes programmatically.

Properties

Name Meaning
Topic ID The unique identifier of the topic to update. You can generate a random ID using unique() or provide a custom string.
Topic Name The new name for the topic.
Additional Fields A collection of optional fields related to the topic. For the "Update Topic" operation specifically, the relevant additional field is:
- Subscribe: Boolean indicating whether the topic allows subscriptions.

Note: In the bundled code, the "subscribe" parameter is passed as the third argument to the update function, but it is not explicitly listed in your provided properties JSON. It is inferred from the code usage.

Output

The output is a JSON object representing the updated topic details returned by the Appwrite API after the update operation completes successfully. This typically includes:

  • The topic's unique ID.
  • The updated name.
  • Subscription status.
  • Other metadata related to the topic.

The exact structure depends on the Appwrite API response for updating a messaging topic.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Appwrite API via an API key credential configured in n8n.
  • The node uses the official Appwrite SDK (node-appwrite) internally.
  • Proper permissions must be granted to the API key to allow updating messaging topics.

Troubleshooting

  • Invalid Topic ID: If the provided Topic ID does not exist, the API will return an error indicating the topic was not found. Verify the Topic ID before running the node.
  • Insufficient Permissions: Errors related to authorization may occur if the API key lacks permission to update messaging topics. Ensure the API key has appropriate scopes.
  • Malformed Parameters: Passing invalid values for the topic name or subscription flag may cause validation errors. Confirm that the topic name is a non-empty string and subscription is a boolean.
  • Network Issues: Connectivity problems with the Appwrite server will result in request failures. Check network access and endpoint URL configuration.

If the node is set to continue on fail, errors will be included in the output JSON; otherwise, execution will stop on error.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion