Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Functions → Update

AI-generated

Overview

This node interacts with the Appwrite API to update a function's configuration and properties. It is useful for managing serverless functions within the Appwrite platform, allowing users to modify function details such as name, runtime environment, execution permissions, event triggers, scheduling, timeout settings, logging, and source code repository integration. Practical examples include updating a function's runtime to a newer Node.js version, changing its execution schedule, or modifying its source code repository settings.

Use Case Examples

  1. Updating a function's runtime from Node.js 18 to Node.js 20 to leverage new features.
  2. Changing the function's schedule to run every hour using a cron expression.
  3. Modifying execution permissions to restrict function access to specific users or roles.
  4. Updating the source code repository branch or root directory for continuous deployment integration.

Properties

Name Meaning
Function ID The unique identifier of the function to update, required for specifying which function to modify.
Name The new name for the function, with a maximum length of 128 characters.
Runtime The execution runtime environment for the function, such as Node.js, Python, PHP, Ruby, Dart, .NET, Java, Swift, Kotlin, C++, Bun, or Deno. Leaving this empty keeps the current runtime.
Options Additional configuration options for the function, including execution permissions, event triggers, scheduling, timeout, enabled state, logging, entrypoint file, build commands, and version control system (VCS) integration settings.

Output

JSON

  • $id - The unique identifier of the updated function.
  • $createdAt - Timestamp when the function was created.
  • $updatedAt - Timestamp when the function was last updated.
  • name - The name of the function.
  • runtime - The runtime environment of the function.
  • execute - Array of permissions defining who can execute the function.
  • events - Array of event strings that trigger the function.
  • schedule - Cron schedule string for automatic execution.
  • timeout - Maximum execution time in seconds.
  • enabled - Boolean indicating if the function is enabled.
  • logging - Boolean indicating if logging is enabled.
  • entrypoint - The entrypoint file for the function.
  • commands - Build commands to execute before running the function.
  • installationId - VCS installation ID for Git integration.
  • providerRepositoryId - VCS repository ID.
  • providerBranch - VCS branch name.
  • providerSilentMode - Boolean indicating if commit status updates are skipped.
  • providerRootDirectory - Path to function code in the repository.
  • templateRepository - Template repository URL.
  • templateOwner - Template repository owner ID.
  • templateRootDirectory - Path to template in the repository.
  • templateBranch - Template branch name.

Dependencies

  • Appwrite API key credential

Troubleshooting

  • Ensure the Function ID is correct and exists in the Appwrite project to avoid 'function not found' errors.
  • Verify that the runtime value is supported and correctly specified to prevent runtime configuration errors.
  • Check that the cron schedule string is valid if scheduling is used, as invalid cron expressions can cause failures.
  • Make sure the API key credential has sufficient permissions to update functions in the Appwrite project.
  • If using VCS integration options, confirm that repository IDs, branch names, and installation IDs are accurate and accessible.
  • Common error messages include authentication failures, invalid input data, and permission denied errors. Resolving these typically involves verifying credentials, input parameters, and user permissions.

Discussion