NAppwrite icon

NAppwrite

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

Overview

This node integrates with the Appwrite API to manage user-related operations within n8n workflows. Specifically, for the "Users" resource and the "List User Sessions" operation, it retrieves all active sessions associated with a specified user ID. This is useful in scenarios where you need to monitor or audit user activity, manage session lifecycles, or implement security measures such as session invalidation.

Practical example:

  • An administrator wants to list all current login sessions of a user to detect suspicious activity or to log out the user from all devices remotely.

Properties

Name Meaning
User ID The unique identifier of the user whose sessions you want to list. This is a required string input.

Output

The output is a JSON array containing details about each user session retrieved from Appwrite. Each item typically includes session identifiers, creation timestamps, expiration times, IP addresses, and device information related to the user's active sessions.

If the node supports binary data output (not indicated here), it would represent session-related files or tokens, but this operation primarily returns JSON data describing user sessions.

Dependencies

  • Requires an active connection to an Appwrite server.
  • Needs credentials including the Appwrite API URL, project ID, and an API key credential configured in n8n.
  • Depends on the node-appwrite SDK and internal helper functions to interact with the Appwrite Users API.

Troubleshooting

  • Common issues:

    • Invalid or missing User ID parameter will cause the operation to fail.
    • Incorrect or expired API credentials can lead to authentication errors.
    • Network connectivity problems between n8n and the Appwrite server may cause timeouts or failures.
  • Error messages:

    • "Resource not found": Indicates that the specified resource or operation is not supported; ensure "Users" resource and "List User Sessions" operation are selected.
    • Authentication errors: Verify that the API key and project ID are correctly set in the node credentials.
    • "User not found" or similar: The provided User ID does not exist in Appwrite; double-check the User ID value.

Links and References

Discussion