ZAppwrite icon

ZAppwrite

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

Overview

This node operation allows you to create a Firebase Cloud Messaging (FCM) provider within the Appwrite messaging service. It is useful when you want to integrate push notification capabilities into your applications using FCM through Appwrite's unified messaging platform.

Typical use cases include:

  • Setting up an FCM provider to send push notifications to mobile or web clients.
  • Automating the creation of messaging providers as part of infrastructure setup workflows.
  • Managing multiple messaging providers programmatically in Appwrite via n8n.

For example, you might use this node to register a new FCM provider by supplying the Firebase service account JSON credentials and enabling the provider, so that your app can start sending push notifications through Appwrite.

Properties

Name Meaning
Provider ID Unique identifier for the provider. You can generate a random ID using unique() or provide a custom string.
Provider Name Human-readable name for the provider.
Service Account JSON The Firebase service account JSON object containing credentials required to authenticate with FCM.
Enabled Boolean flag indicating whether the provider should be enabled immediately after creation.
Additional Fields Collection of optional fields including:
- BCC: Comma-separated list of BCC email addresses
- CC: Comma-separated list of CC email addresses
- Draft: Whether the message is a draft
- Enabled: Whether the provider is enabled
- From Email: Sender email address
- From Name: Sender name
- HTML: Whether email content is HTML
- Scheduled At: Scheduled delivery time in ISO 8601 format
- Targets: Comma-separated list of target IDs
- Topics: Comma-separated list of topic IDs
- Users: Comma-separated list of user IDs

Note: For this specific operation "Create FCM Provider," the relevant properties are primarily Provider ID, Provider Name, Service Account JSON, and Enabled.

Output

The output is a JSON object representing the newly created FCM provider resource as returned by the Appwrite API. This typically includes details such as the provider's unique ID, name, type, configuration, status (enabled/disabled), and metadata related to the FCM integration.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to an Appwrite server with appropriate API credentials configured in n8n.
  • Needs an API key credential with permissions to manage messaging providers in Appwrite.
  • The Firebase service account JSON must be valid and have the necessary permissions to send messages via FCM.

Troubleshooting

  • Invalid Service Account JSON: If the provided Firebase service account JSON is malformed or lacks required permissions, the creation will fail. Ensure the JSON is correctly formatted and corresponds to a valid Firebase project.
  • Duplicate Provider ID: Using a providerId that already exists may cause errors. Use unique() to generate a new ID or ensure your custom ID is unique.
  • API Authentication Errors: If the Appwrite API credentials are incorrect or lack permissions, the node will throw authentication errors. Verify your API key and project settings.
  • Disabled Provider: If the provider is created but disabled, push notifications will not be sent. Make sure the Enabled property is set to true if immediate activation is desired.

Links and References

Discussion