neon-functions

Deploy long-running Node.js HTTP functions on Neon branches with injected database connections.

Updated Sep 13, 2026
One-click install
npx skills add https://github.com/Abhi-0930/online--lms --skill neon-functions-abhi-0930
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neon-functions
Source: https://github.com/Abhi-0930/online--lms/tree/main/backend/.agents/skills/neon-functions
Command: npx skills add https://github.com/Abhi-0930/online--lms --skill neon-functions-abhi-0930

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @neon/config, @neon/functions, @neon/env, hono, drizzle-orm, pg, and includes references (resource) components.

What problem does it solve? Lambda-style serverless functions time out on long-running workloads like AI agent streams, WebSocket servers, and SSE endpoints, and they run far from your database. This Skill guides you through deploying long-running Node.js functions directly onto a Neon branch, with DATABASE_URL injected automatically and compute in the same region as your Postgres data. ## Core Features & Use Cases - Long-Running Handlers: Deploy web-standard fetch handlers with a 15-minute time-to-first-byte budget, supporting streaming agents, WebSocket servers, and SSE endpoints that outlast traditional serverless limits. - Branch-Scoped Backends: Each Neon branch runs its own function version at its own URL against its own isolated database, so preview and CI environments get self-contained backends. - Function Triggers: Schedule cron jobs or react to object-storage uploads that POST to your function, declared in neon.ts or managed via the Neon CLI. - Use Case: You have a Next.js app on Vercel whose AI agent stream gets cut off at 60 seconds. Move just the agent onto a Neon Function, have the browser call it directly with a JWT, and the stream runs next to Postgres without host timeouts. ## Quick Start Ask the AI to define a function in neon.ts with a Hono handler that queries Postgres via the injected DATABASE_URL, then run neon dev locally and neon deploy to get its public invocation URL.

Frequently Asked Questions about neon-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a long-running serverless function next to my Postgres database?▼

Declare the function in neon.ts with a slug and source entry file, then run neon deploy. Neon injects DATABASE_URL automatically, assigns a public HTTPS URL, and runs the function in the same region as your branch's database.

How do I run a WebSocket server on a serverless function?▼

Call upgradeWebSocket from @neon/functions inside your fetch handler and return its response unchanged. The connection stays alive as long as bytes flow, with a 15-minute heartbeat window, and no external state store is needed.

Can Neon Functions replace Vercel or Netlify for hosting my app?▼

No. Neon Functions are backend primitives, not full-stack app hosting. Host your frontend on Vercel or Netlify and use Functions for the long-running, stateful backend slice that belongs next to your Postgres data.

What are the timeout limits for Neon Functions?▼

Handlers must start responding within 15 minutes, open WebSocket and SSE connections stay alive while bytes flow, and waitUntil work runs up to 15 minutes after the response. The runtime is Node.js 24 with 2048 MiB memory.

Which regions support Neon Functions?▼

Neon Functions is currently available only in us-east-2 and eu-central-1. Confirm your Neon project is in one of these regions before setting anything up.

How do I schedule a cron job that calls my function?▼

Declare a trigger of type schedule with a five-field UTC cron expression in neon.ts, or run neon triggers create --cron. Neon POSTs to your function on schedule with the same 15-minute time-to-first-byte limit.