---
title: "Functions"
description: "Deploy serverless Functions with isolated runtimes, schedules, and event triggers. Build backends without managing servers."
canonical: "https://appwrite.io/products/functions"
---

# Serverless Functions for every backend job

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

[Start building](https://appwrite.io/sign-up?redirect=%2F)[View docs](https://appwrite.io/docs/products/functions)

HTTP

POST /orders

Cron

0 \*/6 \* \* \*

Event

users.\*.create

![node](https://appwrite.io/icons/node.svg)

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](https://appwrite.io/icons/node.svg)
* ![bun](https://appwrite.io/icons/bun.svg)
* ![deno](https://appwrite.io/icons/deno.svg)
* ![go](https://appwrite.io/icons/go.svg)
* ![python](https://appwrite.io/icons/python.svg)
* ![dart](https://appwrite.io/icons/dart.svg)
* ![php](https://appwrite.io/icons/php.svg)
* ![ruby](https://appwrite.io/icons/ruby.svg)
* ![dotnet](https://appwrite.io/icons/dotnet.svg)
* ![java](https://appwrite.io/icons/java.svg)
* ![swift](https://appwrite.io/icons/swift.svg)
* ![kotlin](https://appwrite.io/icons/kotlin.svg)
* ![flutter](https://appwrite.io/icons/flutter.svg)
* ![cpp](https://appwrite.io/icons/cpp.svg)
* ![rust](https://appwrite.io/icons/rust.svg)

## 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.

[Deploy from Git docs](https://appwrite.io/docs/products/functions/deploy-from-git)

Git repository

appwrite/backend

Connected

feat: add webhook handler

maina41f9c22m ago

Active

fix: retry failed charges

PR #1287d03e182m ago

Preview

chore: bump stripe sdk

mainc92b6a4Yesterday

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.

[Deployments docs](https://appwrite.io/docs/products/functions/deployments)

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.

[Function domains docs](https://appwrite.io/docs/products/functions/domains)

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 }
```

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.

[Execute functions docs](https://appwrite.io/docs/products/functions/execute)

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 docs](https://appwrite.io/docs/products/functions/executions)

Executions

68a4e2f91b0cEventPOST /342ms

68a4d8c03f21SchedulePOST /1.2s

68a4d2e19a44EmailPOST /890ms

68a4c1aa7e55HTTPPOST /webhook89ms

68a4b9024d18EventPOST /410ms

68a4a11fc873HTTPGET /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.

[Runtimes docs](https://appwrite.io/docs/products/functions/runtimes)

![node](https://appwrite.io/icons/node.svg)

Node.js

node-22

Ready to deploy

node-22

node-20

node-18

13+ runtimes

Your language, your runtime

Pin your version. Deploy isolated. Built for production.

## 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 development docs](https://appwrite.io/docs/products/functions/develop-locally)

Local dev

localhost:3000

Config

appwrite.config.json

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

$ 

Impersonate user

\--user-id <id>

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.

[Templates docs](https://appwrite.io/docs/products/functions/templates)

Search templates...Function templates

AllPaymentsAISearchMessaging

Payments

Payments with Stripe

Receive card payments and store paid orders.

![node](https://appwrite.io/icons/node.svg)Node.js

Search

Sync with Meilisearch

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

![node](https://appwrite.io/icons/node.svg)Node.js

AI

Prompt ChatGPT

Ask questions and let GPT answer from your app.

![python](https://appwrite.io/icons/python.svg)Python

Messaging

Discord Command Bot

Add slash commands to your Discord servers.

![go](https://appwrite.io/icons/go.svg)Go

## 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 APIREST, GraphQL, and SDKs for every service. Automate and integrate without console-only workflows.](https://appwrite.io/docs/apis/rest)[ConsoleManage every service in your project from a unified Console. Optimized keyboard access and a Command Center keep you moving fast.⌘KCommand Center](https://appwrite.io/docs/tooling/command-center)[RealtimeSubscribe to live events and react to changes as they happen.functions.\*.executions.\*functions.\*.executions.\*.create](https://appwrite.io/docs/apis/realtime)[MCPConnect AI agents to your Appwrite project, APIs, and docs through one remote MCP server.appwrite https://mcp.appwrite.io](https://appwrite.io/docs/tooling/ai/mcp-servers)[TerraformManage Appwrite infrastructure as code with the official provider.terraform plan terraform apply](https://appwrite.io/docs/tooling/terraform/resources/functions)[Agent skillsGive AI agents SDK-accurate knowledge of Appwrite services and APIs.npx skills add appwrite/skills](https://appwrite.io/docs/tooling/ai/skills)[SDKsClient and server SDKs for the platforms your team already uses. 15 official SDKs available across client and server runtimes.](https://appwrite.io/docs/sdks)[CLIDeploy resources, manage projects, and generate typed SDKs from your terminal.appwrite login appwrite deploy](https://appwrite.io/docs/tooling/command-line/installation)

## 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.

[Runtimes](https://appwrite.io/docs/products/functions/runtimes)

### 

Sync executions run over HTTP domains or the SDK with async set to false. Appwrite waits for your function and returns the response, with a 30 second hard limit. Async executions are queued for events, cron schedules, and SDK calls with async set to true. They run in the background and use your function timeout, up to 15 minutes.

[Execution modes](https://appwrite.io/docs/products/functions/execute#execution-modes)

### 

Yes. Every function gets a generated domain and you can add custom domains on Appwrite Cloud. Pass x-appwrite-user-jwt to authenticate users and respect Auth permissions inside your function.

[Function domains](https://appwrite.io/docs/products/functions/domains)[Execute functions](https://appwrite.io/docs/products/functions/execute)

### 

Open the Executions tab in the Console to review status, trigger, method, path, and duration for each run. Execution details include logs, errors, and headers. Request and response bodies are not logged by default for privacy. Use log() and error() in your handler for the output you want to retain.

[Executions](https://appwrite.io/docs/products/functions/executions)

### 

Connect a repository in the Console, set a production branch and root directory, then deploy on every push. Branch and path filters use glob patterns, matching the Sites Git workflow.

[Deploy from Git](https://appwrite.io/docs/products/functions/deploy-from-git)

### 

Appwrite caches your package manager store between deployments, keyed automatically per function. pnpm, bun, npm, and yarn installs are faster on the next build with no extra configuration. If a cache restore fails, the build continues normally.

[Deployments](https://appwrite.io/docs/products/functions/deployments)

### 

Yes. The Appwrite CLI runs your function in Docker on localhost with hot reload, the same runtime image as production, and optional user impersonation for Auth-aware testing.

[Develop locally](https://appwrite.io/docs/products/functions/develop-locally)

### 

Yes. Functions receive an ephemeral API key and run with project context. Configure scopes in Settings, then call Databases, Storage, Messaging, Auth, and other APIs from server SDKs inside your handler.

[Develop functions](https://appwrite.io/docs/products/functions/develop)

## Start building with Functions

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

[Start building](https://appwrite.io/sign-up?redirect=%2F)[View pricing](https://appwrite.io/pricing)

## Explore Appwrite

Modular backend services that share the same project, permissions model, and console.

[AuthEmail, OAuth, SMS, MFA, teams, and sessions.](https://appwrite.io/products/auth)

[DatabasesManaged PostgreSQL, TablesDB, DocumentsDB, VectorsDB, MySQL.](https://appwrite.io/products/databases)

[PostgreSQLManaged PostgreSQL with pooling, replicas, and PITR.](https://appwrite.io/products/postgres)

[StorageUpload, transform, and deliver files on CDN.](https://appwrite.io/products/storage)

[FunctionsAPIs, cron jobs, and event handlers at scale.](https://appwrite.io/products/functions)

[MessagingEmail, SMS, and push with topics and targets.](https://appwrite.io/products/messaging)

[RealtimeLive events, channels, and presence.](https://appwrite.io/products/realtime)

[SitesStatic, SSR, and CSR deploys from Git.](https://appwrite.io/products/sites)

[DomainsSearch, buy, transfer, and manage domains.](https://appwrite.io/domains)

[FirewallProject rules to deny, rate limit, and redirect traffic.](https://appwrite.io/products/firewall)

### 

### 

### 

### 

### 

### 

[](https://github.com/appwrite)[](https://x.com/appwrite)[](https://youtube.com/@appwrite)[](https://www.linkedin.com/company/appwrite/)[](https://www.instagram.com/appwrite.io/)[](https://appwrite.io/discord)[](https://apwr.dev/dailydev)

[SOC 2 Type II Certified](https://appwrite.io/docs/advanced/security)

© 2026 Appwrite
