ZAppwrite icon

ZAppwrite

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

Overview

This node allows you to interact with Appwrite's cloud functions by executing a specified function. It is useful when you want to trigger serverless functions hosted on Appwrite directly from your n8n workflows, passing custom data and optionally controlling execution details such as HTTP method, headers, asynchronous execution, scheduling, and response extraction.

Practical examples include:

  • Running a backend function to process or transform data.
  • Triggering an asynchronous job in Appwrite and continuing workflow without waiting.
  • Scheduling a function execution at a specific time.
  • Extracting specific parts of the function response using XPath.

Properties

Name Meaning
Function ID The unique identifier of the Appwrite function to execute.
Data JSON data payload to send as input to the function.
Additional Fields Optional settings for execution:
• Async: Whether to run the function asynchronously (true/false).
• Headers: Additional HTTP headers to include.
• Method: HTTP method to use for the function call (DELETE, GET, PATCH, POST, PUT).
• Scheduled At: ISO 8601 timestamp to schedule the function execution.
• XPath: XPath expression to extract specific data from the function response.

Output

The node outputs the JSON response returned by the executed Appwrite function. This output contains the result of the function execution, which can be any JSON-serializable data depending on the function's implementation.

If the function returns binary data, it would typically be encoded within the JSON response or handled separately by Appwrite; this node does not explicitly handle binary output.

Dependencies

  • Requires an active Appwrite project with cloud functions configured.
  • Needs an API key credential with permissions to execute functions.
  • The node uses the Appwrite SDK client initialized with the project URL, project ID, and API key.
  • No additional environment variables are required beyond the configured credentials.

Troubleshooting

  • Common issues:

    • Invalid Function ID: Ensure the function ID exists in your Appwrite project.
    • Authentication errors: Verify that the API key credential has sufficient permissions.
    • Malformed JSON in "Data" property: Confirm that the JSON input is valid.
    • Incorrect HTTP method or headers may cause unexpected function behavior.
    • Scheduling errors if the "Scheduled At" timestamp is invalid or in the past.
  • Error messages:

    • Errors thrown by the Appwrite SDK will propagate, e.g., "Function not found" or "Unauthorized".
    • If the node is set to continue on fail, errors will be included in the output JSON under an error field.
  • Resolution tips:

    • Double-check all input parameters for correctness.
    • Use synchronous execution initially to verify function behavior before enabling async or scheduling.
    • Validate JSON inputs with external tools.
    • Check Appwrite server logs for detailed error information.

Links and References

Discussion