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.

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.

OverviewDeploymentsSettings

Git repository

Auto-build on push with branch and path filters.

Connected

Repository

appwrite/backend

Production branch

main

Root directory

functions/stripe-webhook

Build triggers

main, release/*
paths:functions/**

feat: add webhook handler

main · 2m ago

Active

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.

OverviewDeploymentsSettings

Build logs

Duration: 24s
1
[10:24:01] Starting build for process-order
2
[10:24:02] Restoring dependency cache
3
[10:24:03] Dependency cache restored in 1.2s
4
[10:24:03] Running build command: pnpm install --frozen-lockfile
5
[10:24:05] Lockfile is up to date, resolution step skipped
6
[10:24:07] Packages: +42
7
[10:24:11] Done in 8.1s (cache hit)
8
[10:24:11] Running build command: npm run build
9
[10:24:14] Compiling TypeScript…
10
[10:24:18] Bundling function entrypoint
11
[10:24:21] Optimizing output for node-22
12
[10:24:23] Build finished successfully
13
[10:24:23] Packaging deployment artifact

Deployments

Deployment IDStatusDurationCreated
67abc12f9e2dActive24s2m ago
89def45a1c8bReady1m 12sYesterday

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.

OverviewDomainsSettings

Function domain

Sync HTTP for APIs and webhooks.

GET · POST

Generated domain

https://65f1a2b3.appwrite.run

Request

POST /
Content-Typeapplication/json
x-appwrite-user-jwteyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…

Pass a user JWT so Server SDKs inside the function respect Auth permissions.

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

Event-driven

Async

React to platform events as they occur.

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

Webhooks, sync jobs, and reactive workflows.

A customer completes checkout

Send receipt, update inventory, and notify fulfillment

Scheduled executions

When the clock hits

Time-based

Pick a preset or write a custom cron expression.

Preset

Every hour

0 * * * *

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

Reports, cleanups, and recurring background jobs.

Every Monday at 9 AM

Email the team a weekly sales and usage digest

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.

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.

OverviewExecutionsSettings
Execution IDStatusTriggerMethodDurationCreated
68a4e2f91b0cCompletedEventPOST342ms2m ago
68a4d8c03f21CompletedSchedulePOST1.2s18m ago
68a4c1aa7e55CompletedHTTPPOST89ms1h ago
68a4b9024d18CompletedEventPOST410ms3h ago
68a4a11fc873CompletedHTTPGET12ms5h ago
68a48e6a2b90CompletedSchedulePOST2.4sYesterday

Execution details

68a4e2f91b0c

Completed200
Trigger
Event
Duration
342ms
Method
POST
Path
/
Event: databases.*.tables.*.rows.*.create
Processing order ord_8f2a91c
Updated inventory for 3 SKUs
Sent receipt via Messaging topic "receipts"

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.

Runtime

node-22

Your language, your runtime

Pin your version. Deploy isolated. Built for production.

13+ runtimes

Ready to deploy

nodenode-22
Node.js
bunbun-1.3
Bun
pythonpython-3.12
Python
gogo-1.23
Go
dartdart-3.11
Dart
phpphp-8.3
PHP
rubyruby-3.3
Ruby
rustrust-1.83
Rust
denodeno-2.0
Deno

And more

dotnet.NET
javaJava
swiftSwift
kotlinKotlin
flutterFlutter
cppC++

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

Appwrite CLI

Run on localhost

Same Docker runtime as production, on your machine.

Hot reload
Terminal

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

Building function using Docker…

Starting function using Docker…

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

Config

appwrite.config.json

Impersonate user

--user-id <id>

Edit your code and the function restarts automatically. Deploy when you are ready.

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.

FunctionsTemplates

Function templates

Pre-built integrations to skip boilerplate.

Catalog
Search templates...
Payments

Payments with Stripe

Receive card payments and store paid orders.

nodenode
AI

Prompt ChatGPT

Ask questions and let GPT answer from your app.

pythonpython
Search

Sync with Meilisearch

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

nodenode
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 MCP servers.

appwrite-docs
appwrite-api

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/agent-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.