Appwrite icon

Appwrite

A comprehensive node for the Appwrite API

Overview

This node integrates with the Appwrite API to manage serverless functions within an Appwrite project. Specifically, the Update Function operation allows users to modify an existing function's metadata such as its name, runtime environment, and execution access roles.

Typical use cases include:

  • Updating a function's runtime to a newer version (e.g., upgrading from Node.js 18 to Node.js 20).
  • Changing the function's name for better clarity or organization.
  • Adjusting which user roles have permission to execute the function, enhancing security or collaboration.

For example, a developer might update a function named "ImageProcessor" to run on Python 3.12 instead of Python 3.11, or restrict execution access to only admin roles.

Properties

Name Meaning
Function ID Unique identifier of the function to update.
Name New name to assign to the function.
Runtime The execution runtime environment for the function. Options include:
- Node.js 18.0
- Node.js 20.0
- PHP 8.2
- PHP 8.3
- Ruby 3.2
- Ruby 3.3
- Python 3.11
- Python 3.12
- Deno 1.35
- Dart 3.0
- Dart 3.1
- Bun 1.0
- Java 18.0
- Swift 5.8
- Kotlin 1.8
- .NET 7.0
Execute Access Roles JSON array of role strings specifying which roles can execute the function. Example: ["role:all"]

Output

The output is a JSON object representing the updated function resource returned by the Appwrite API. It typically includes details such as the function's ID, name, runtime, permissions, and other metadata reflecting the updated state.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the Appwrite API via an API key credential configured in n8n.
  • The node depends on the Appwrite SDK client internally to communicate with the Appwrite server.
  • Proper permissions on the Appwrite project are necessary to update functions.

Troubleshooting

  • Common Issues:

    • Invalid or missing Function ID will cause the update to fail.
    • Providing an unsupported runtime value will result in an error.
    • Insufficient permissions or invalid API credentials will prevent successful updates.
    • Malformed JSON in the Execute Access Roles property may cause parsing errors.
  • Error Messages:

    • "Function not found": Verify the Function ID is correct.
    • "Unauthorized" or "Permission denied": Check API credentials and user permissions.
    • "Invalid runtime specified": Ensure the runtime matches one of the supported options.
    • JSON parsing errors for the roles array: Confirm the JSON syntax is valid.

To resolve these issues, verify all input parameters, ensure valid credentials, and confirm that the Appwrite project settings allow function updates.

Links and References

Discussion