ZAppwrite icon

ZAppwrite

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

Overview

The node integrates with Appwrite's Messaging API to create push notifications. It allows users to send customized push messages to specific targets, users, or topics within their Appwrite project. This is useful for alerting app users about updates, promotions, reminders, or any real-time information.

Typical use cases include:

  • Sending a promotional push notification to all users subscribed to a topic.
  • Delivering personalized alerts to specific user IDs.
  • Scheduling push notifications for future delivery.

Properties

Name Meaning
Message ID Unique identifier for the message. Can be generated automatically using unique() or set manually.
Title The title text of the push notification.
Body The main content/body text of the push notification.
Additional Fields Optional extra parameters including:
- Topics: Comma-separated list of topic IDs
- Users: Comma-separated list of user IDs
- Targets: Comma-separated list of target IDs
- Data: Custom data payload (not shown in properties but used internally)
- Action, Image, Icon, Sound, Color, Tag, Badge: Various push notification customization options (used internally)
- Draft: Boolean indicating if the message is a draft
- Scheduled At: ISO 8601 timestamp for scheduled delivery

Note: The "Additional Fields" collection supports specifying recipients and scheduling details, enhancing flexibility in targeting and timing.

Output

The node outputs an array containing the response from the Appwrite API after creating the push notification message. The output JSON typically includes details about the created message such as its ID, status, and metadata confirming successful creation.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Appwrite project with Messaging service enabled.
  • Needs credentials providing the Appwrite endpoint URL, project ID, and an API key with permissions to manage messaging.
  • The node uses the official Appwrite SDK (node-appwrite) to communicate with the API.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Providing an invalid ISO 8601 date format in "Scheduled At" may result in errors.
    • Specifying non-existent user, target, or topic IDs will likely cause the API to reject the request.
    • Omitting required fields like Message ID, Title, or Body will trigger validation errors.
  • Error Messages:

    • Authentication errors: Check that the API key and project ID are correct and have sufficient permissions.
    • Validation errors: Ensure all required fields are provided and correctly formatted.
    • Network errors: Verify connectivity to the Appwrite server URL.

Resolving these usually involves verifying credentials, input formats, and network access.

Links and References

Discussion