ZAppwrite icon

ZAppwrite

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

Overview

This node integrates with the Appwrite API to retrieve avatar-related images. Specifically, the Get Flag Icon operation fetches a flag icon image for a given country code. This is useful in scenarios where you want to display country flags dynamically based on user input or data, such as in dashboards, user profiles, or internationalized applications.

For example, if you have a list of users from different countries and want to show their respective country flags next to their names, this node can fetch the appropriate flag icons by providing the two-letter ISO country code.

Properties

Name Meaning
Country Code Two-letter country code (ISO 3166-1 alpha-2) specifying which country's flag to retrieve.
Additional Fields Optional settings including:
- Background Color (hex color for initials avatar background)
- Download (boolean to force download)
- Height (image height in pixels)
- Margin (QR code margin)
- Quality (image quality 0-100)
- Size (QR code size in pixels)
- Width (image width in pixels)

For the Get Flag Icon operation, the relevant additional fields used are:

  • Width: Width of the flag image in pixels (default 100).
  • Height: Height of the flag image in pixels (default 100).

Other additional fields exist but are not applicable to this operation.

Output

The output contains a JSON object with a data field holding the flag icon image data. The image is returned in a format suitable for further processing or direct use in UI components.

If binary data is involved (e.g., the actual image file), it will be included in the data field, typically as a base64-encoded string or a URL depending on the underlying Appwrite SDK response.

Dependencies

  • Requires an active connection to the Appwrite API.
  • Needs credentials configured in n8n that provide:
    • The Appwrite API endpoint URL.
    • A valid project ID.
    • An API key credential for authentication.

No other external dependencies are required.

Troubleshooting

  • Invalid Country Code: If the provided country code is not a valid ISO 3166-1 alpha-2 code, the node may return an error or no image. Ensure the country code is correct and uppercase.
  • Authentication Errors: If the API key or project ID is incorrect or missing, the node will fail to connect. Verify credentials in n8n.
  • Network Issues: Connectivity problems to the Appwrite server will cause failures. Check network access and Appwrite server status.
  • Image Size Parameters: Providing non-numeric or invalid values for width/height may cause unexpected results or errors. Use positive integers.

Common error messages usually relate to authentication failure, resource not found, or invalid parameters. Resolving these involves checking credentials, verifying input parameters, and ensuring the Appwrite service is reachable.

Links and References

Discussion