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

# Overview

> Server-side TypeScript that runs inside Upshift — triggered by HTTP routes, cron schedules, database events, AI tools, or workflow actions.

A Upshift app's **logic layer** is the code that *runs* — server-side TypeScript handlers reacting to HTTP requests, cron schedules, and record changes; AI skills and agents that live inside the workspace; and OAuth connections that let your functions act on a user's behalf in third-party services.

```text theme={null}
            ┌─ HTTP route      ──┐
            │  Cron schedule     │
            │  Database event    │      ┌────────────────────┐
  triggers ─┤  AI tool call      ├─────▶│ Logic function     │
            │  Workflow action   │      │ (your handler)     │
            │  Manual exec       │      └────────────────────┘
            └────────────────────┘                │
                                                  ▼
                                  ┌────────────────────────────┐
                                  │ Upshift API (records)      │
                                  │ Third-party API            │
                                  │   (via Connection token)   │
                                  └────────────────────────────┘
```

## In this section

> **[Logic Functions](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/logic-functions.md)**
>
> The core building block — trigger types, payloads, and the typed API client.

> **[Skills & Agents](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/skills-and-agents.md)**
>
> Reusable AI agent instructions and assistants with custom system prompts.

> **[Workflows](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/workflows.md)**
>
> Ready-made workflows installed with your app: triggers, steps, and how they run.

> **[Connections](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/connections.md)**
>
> OAuth credentials your app holds for third-party services — Linear, GitHub, Slack, and more.

> **[Messaging Channels](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/messaging-channels.md)**
>
> Bring conversations from any provider into Upshift's Message and Message Thread records — threading and de-duplication included.

> **[Key-Value Store](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/key-value-store.md)**
>
> Persist state between logic function runs — caches, cursors, and cross-workspace claims.

> **[Background Jobs](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/background-jobs.md)**
>
> Enqueue a logic function run on the workers to get past the per-run timeout.

> **[Charging Credits](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/credits.md)**
>
> Declare what your app bills for and charge workspace credits for it.

## Trigger types at a glance

A logic function picks one or more triggers — every entry below is a separate field on `defineLogicFunction()`:

| Trigger | When it runs | Setting |
| - | - | - |
| **HTTP route** | A request hits your `/s/<path>` endpoint | `httpRouteTriggerSettings` |
| **Cron** | A CRON expression matches | `cronTriggerSettings` |
| **Database event** | A workspace record is created, updated, or deleted | `databaseEventTriggerSettings` |
| **AI tool** | A Upshift AI feature decides to call your function | `toolTriggerSettings` |
| **Workflow action** | A workflow step invokes your function | `workflowActionTriggerSettings` |

Functions run sandboxed in isolated Node.js processes and access the workspace through a typed API client scoped to the role declared on [`defineApplication()`](https://docs.upshiftcloud.com/en/developers/extend/apps/config/application).

> [!NOTE]
>
> **Install-time hooks** — code that runs before or after the install — share this runtime but use their own define functions and live under [Config → Install Hooks](https://docs.upshiftcloud.com/en/developers/extend/apps/config/install-hooks.md).
>
> The [**health check**](https://docs.upshiftcloud.com/en/developers/extend/apps/logic/logic-functions.md#health-check) shares it too. It declares no trigger: Upshift calls it on demand when the app's settings page opens.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.