Skip to content
Appwrite Functions

Serverless Functions for every backend job_

Run API endpoints, webhooks, cron jobs, and event handlers in secure isolated runtimes that scale with demand.

HTTP

POST /orders

Cron

0 */6 * * *

Event

users.*.create

node

process-order

Node.js 22

Ready1 vCPU · 512 MB
Execution logs
  • 200POST /orders34ms
  • 200cron 0 */6 * * *1.2s
  • 200users.*.create18ms
  • 201POST /orders41ms
  • 200GET /orders/4212ms
Language runtimes
13+
Local-first development
CLI
Schedule triggers
Cron
Platform event hooks
Events
Repository deploys
Git

13+ runtimes. Develop locally, deploy when ready.

  • node
  • bun
  • deno
  • go
  • python
  • dart
  • php
  • ruby
  • dotnet
  • java
  • swift
  • kotlin
  • flutter
  • cpp
  • rust

Deploy from Git with auto-build on push

Connect a repository and deploy on every push, the same workflow as Sites. Set a production branch that auto-activates successful builds, filter by branch or path with glob patterns, and review preview deployments from pull requests.

Git repository

appwrite/backend

Connected

feat: add webhook handler

main2m ago

Active

fix: retry failed charges

PR #1282m ago

Preview

chore: bump stripe sdk

mainYesterday

Ready

Production branch

main

Build triggers

mainrelease/*functions/**

Fast builds with built-in dependency cache

Every deployment runs through Appwrite's build pipeline with logs you can inspect in the Console. Package manager stores for npm, pnpm, yarn, and bun are cached automatically between builds, so repeat installs skip duplicate work. Tune build and runtime CPU and memory separately when compilation needs more headroom than steady execution.

Building67abc12f9e2dDuration: 24s
  1. Restoring dependency cache

    1.2s
  2. pnpm install --frozen-lockfile

    8.1s
  3. npm run build

    12s
  4. Packaging deployment artifact

Cache hit

-8.1s

Specifications

Build2 vCPU · 2 GB
Runtime0.5 vCPU · 512 MB

HTTP endpoints via domains

Every function gets a generated URL and optional custom domain for sync HTTP APIs and webhooks. Pass user sessions with the x-appwrite-user-jwt header so your function respects Auth permissions inside Server SDKs.

Request

POST /

https://api.acme.io/

Content-Type

application/json

x-appwrite-user-jwt

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…

Function domain

Generated domain

65f1a2b3.appwrite.run

Custom domains

api.acme.io

Verified
20089ms
{ "received": true }

Event triggers and scheduled executions

Run functions asynchronously on platform events or on a cron schedule. Sync HTTP calls and SDK executions with async disabled return responses immediately but cap at 30 seconds. Events, cron jobs, and queued executions run in the background with your configured timeout, up to 15 minutes.

Event triggers

When something happens

React to platform events as they occur.

databases.*.tables.*.rows.*.create
users.*.sessions.*.create
storage.buckets.*.files.*.create

A customer completes checkout

Send receipt, update inventory, and notify fulfillment

Execution modes

Sync

30s limit

HTTP domains and SDK calls with async disabled. Response body returned to the caller.

Async

Background

Platform events, cron schedules, and queued executions. Uses your configured timeout.

0s30s15 minutes

Scheduled executions

When the clock hits

Pick a preset or write a custom cron expression.

09**1
Every hour0 * * * *
Every day at midnight0 0 * * *
Every Monday at 9 AM0 9 * * 1

Every Monday at 9 AM

Email the team a weekly sales and usage digest

Executions and observability

Every run creates an execution you can inspect in the Console. Review status, trigger, method, path, and duration in the executions table, then open details for logs, errors, and headers. Request and response bodies are not stored by default. Use log() and error() for the audit trail you need.

Executions

68a4e2f91b0cPOST /342ms
68a4d8c03f21POST /1.2s
68a4c1aa7e55POST /webhook89ms
68a4b9024d18POST /410ms
68a4a11fc873GET /health12ms

Execution details

68a4c1aa7e55

Completed200
Trigger
HTTP
Method
POST
Path
/webhook
Duration
89ms
LogsErrorsHeadersBody
  • logReceived checkout.session.completed
  • logProcessing order ord_8f2a91c
  • logUpdated inventory for 3 SKUs
  • logSent receipt via Messaging topic "receipts"
Response bodies are not stored by default.

13+ runtimes, your stack

Code in Node, Bun, Python, Go, Rust, Dart, and more. Pin the version you ship with and deploy without relearning the platform.

node

Node.js

node-22
13+ runtimes

Develop and run functions locally

Use the Appwrite CLI and Docker to run functions on localhost with hot reload. Test with production-style headers, impersonate users, and deploy when you are ready.

Local dev

localhost:3000

Terminal
appwrite-cli

$ appwrite run functions --function-id stripe-webhook

Building function using Docker…

Starting function using Docker…

Visit http://localhost:3000/ to execute your function.

File changed: src/main.js

Function restarted in 412ms

$

Hot reload

Function templates catalog

Start from the Console Templates tab with pre-built integrations for Stripe payments, OpenAI prompts, search sync, Discord bots, and more. Filter by use case or runtime and skip boilerplate when wiring new backend jobs.

Search templates...Function templates
AllPaymentsAISearchMessaging
Payments

Payments with Stripe

Receive card payments and store paid orders.

nodeNode.js
Search

Sync with Meilisearch

Index database rows for search-as-you-type.

nodeNode.js
AI

Prompt ChatGPT

Ask questions and let GPT answer from your app.

pythonPython
Messaging

Discord Command Bot

Add slash commands to your Discord servers.

goGo

Tools built for developers and agents_

API-first by design. Use the Console, Realtime, SDKs, CLI, Terraform, MCP, and agent skills on the same project.

Developer and agent experience

A typical function handler.

JavaScript
import { Client } from 'node-appwrite';
export default async ({ req, res, log }) => {
log(`${req.method} ${req.path}`);
const { orderId } = JSON.parse(req.body);
if (!orderId) {
return res.json({ error: 'Missing orderId' }, 400);
}
const client = new Client()
.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
.setKey(req.headers['x-appwrite-key']);
log(`Processing ${orderId} (${process.env.APPWRITE_FUNCTION_NAME})`);
return res.json({ status: 'fulfilled', orderId });
};

Everything is an API

REST, GraphQL, and SDKs for every service. Automate and integrate without console-only workflows.

Console

Manage every service in your project from a unified Console. Optimized keyboard access and a Command Center keep you moving fast.

⌘KCommand Center

Realtime

Subscribe to live events and react to changes as they happen.

functions.*.executions.*

functions.*.executions.*.create

MCP

Connect AI agents to your Appwrite project, APIs, and docs through one remote MCP server.

appwrite
https://mcp.appwrite.io

Terraform

Manage Appwrite infrastructure as code with the official provider.

terraform plan
terraform apply

Agent skills

Give AI agents SDK-accurate knowledge of Appwrite services and APIs.

npx skills add appwrite/skills

SDKs

Client and server SDKs for the platforms your team already uses. 15 official SDKs available across client and server runtimes.

CLI

Deploy resources, manage projects, and generate typed SDKs from your terminal.

appwrite login
appwrite deploy

FAQ_

Appwrite supports 13+ runtimes including Node.js, Bun, Python, Go, Dart, PHP, Ruby, Rust, and Deno. Each runtime has multiple version tags so you can pin the environment that matches production.

Start building with Functions_

Deploy your first function from a template or your own codebase in minutes.