> ## Documentation Index
> Fetch the complete documentation index at: https://archie.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Server-side functions in Archie.

Custom functions are server-side handlers you author and deploy alongside your Archie app. Use them when the auto-generated CRUD APIs are not enough — webhook receivers, scheduled jobs, complex transactions, third-party API calls.

## When to write a function vs. extend the API

* **Auto-generated CRUD endpoint** — sufficient for most reads and writes
* **Custom function** — for arbitrary logic, integrations, side effects, or complex orchestration

If you need to call a third-party API, run a calculation, or perform a multi-step workflow, write a function. Functions are the natural place to call [integrations](/features/backend/integrations/overview) (Stripe, SendGrid, Twilio, etc.) — credentials live on the integration record and the function calls the auto-generated GraphQL operations the integration adds to your schema.

## Anatomy of a function

A function has:

* **Name** — used as the route key or trigger identifier
* **Trigger** — HTTP request, scheduled cron, webhook receiver, or queued job {/* VERIFY: confirm exact trigger types supported */}
* **Handler code** — the body, written in your project's backend language
* **Configuration** — environment variables, integration credentials it needs, timeouts
* **Response shape** — what callers receive (for HTTP/webhook triggers)

## What is here

* **[Writing custom functions](/features/backend/custom-functions/writing)** — authoring patterns and language details
* **[Deploying custom functions](/features/backend/custom-functions/deploying)** — pushing to staging and production

## FAQ

<AccordionGroup>
  <Accordion title="What language do functions use?">
    The language of your project's backend stack — typically TypeScript on Node, but matches whatever you chose in the blueprint. {/* VERIFY: confirm full list of supported runtimes */}
  </Accordion>

  <Accordion title="Are functions cold-started?">
    Depends on deployment target. Archie-hosted functions are warm-pooled to minimize cold starts. {/* VERIFY: confirm cold start behavior */}
  </Accordion>

  <Accordion title="Can a function call another function?">
    Yes. Use the generated client or a direct HTTP call.
  </Accordion>
</AccordionGroup>
