Actions44
- User Actions
- Database Actions
- Collection Actions
- Document Actions
- Index Actions
- Function Actions
- Storage Actions
Overview
This node integrates with the Appwrite API to manage serverless functions within an Appwrite project. Specifically, the "Function - Create" operation allows users to create a new function resource by specifying its unique ID, name, runtime environment, and execution access roles.
Common scenarios where this node is beneficial include automating deployment of backend functions, managing cloud functions programmatically, or integrating function creation into larger workflows that require dynamic function provisioning.
For example, a user might use this node to automatically create a new Node.js function with specific access permissions as part of a CI/CD pipeline or to provision functions on-demand based on application needs.
Properties
| Name | Meaning |
|---|---|
| Function ID | Unique identifier for the function. Use "unique()" to auto-generate an ID during creation. |
| Name | A human-readable name for 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 defining which roles can execute the function, e.g., ["role:all"]. |
Output
The node outputs a JSON object representing the created function resource as returned by the Appwrite API. This typically includes details such as the function's ID, name, runtime, permissions, and other metadata.
If the operation succeeds, the output contains the full function data; if it fails, error information is provided.
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 client library internally to communicate with the Appwrite server.
- Proper permissions and roles must be set in Appwrite to allow function creation.
Troubleshooting
Common Issues:
- Invalid or missing API credentials will cause authentication failures.
- Using a non-unique Function ID may result in conflicts or errors.
- Specifying an unsupported runtime value will cause validation errors.
- Improperly formatted JSON in the Execute Access Roles property can cause parsing errors.
Error Messages:
- Authentication errors indicate issues with the API key or permission scopes.
- Validation errors often specify which input parameter is invalid or missing.
- Network or connectivity errors suggest problems reaching the Appwrite server.
Resolutions:
- Verify API credentials and ensure they have sufficient permissions.
- Use
"unique()"to auto-generate a Function ID to avoid conflicts. - Double-check the runtime option against the supported list.
- Ensure JSON arrays (like Execute Access Roles) are properly formatted.