neon-functions

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

78|38|Updated Oct 20, 2022
One-click install
npx skills add https://github.com/neondatabase/examples --skill neon-functions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neon-functions
Source: https://github.com/neondatabase/examples/tree/main/bots/discord-bot-http/.agents/skills/neon-functions
Command: npx skills add https://github.com/neondatabase/examples --skill neon-functions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Traditional lambda-style serverless functions have short execution timeouts (typically 10–60 seconds) that cut off long-running workloads such as AI agents with multiple tool calls, WebSocket servers, streaming APIs, and webhook handlers that perform multiple database writes. This Skill solves that by enabling deployment of long-running, serverless Node.js HTTP functions directly onto your Neon database branch, with no hard timeout for steady data flow.

Core Features & Use Cases

  • Long-running execution: Supports workloads that outlast traditional serverless limits, including multi-step AI agents, image/video generation, and persistent streaming endpoints.
  • Proximity to Postgres: Automatically injects DATABASE_URL for direct database access, with compute running in the same region as your database to eliminate cross-region latency.
  • Branchable deployments: Each Neon branch runs its own isolated function instance at a unique URL, making it perfect for preview environments, CI, and development workflows.
  • Multiple workload types: Natively supports WebSocket servers, server-sent events (SSE) endpoints, MCP servers, AI agent backends, and standard request/response APIs.
  • Real-world use case: Host a Discord bot or streaming customer support chatbot that maintains persistent connections and queries your Neon Postgres database in real time without timing out.

Quick Start

Use the neon-functions skill to deploy a long-running WebSocket server or streaming AI agent that runs on your Neon database branch with automatic DATABASE_URL injection and no timeout constraints for active connections.

Frequently Asked Questions about neon-functions

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

FAQPage Schema
How do I host a WebSocket server or streaming AI agent without hitting serverless timeout limits?

You can host long-running WebSocket servers and streaming AI agents on Neon Postgres using Neon Functions. This serverless compute eliminates hard execution timeouts for steady data flow and active connections, preventing workload cutoffs.

Why does my serverless AI agent backend fail during multi-step database writes?

Traditional lambda-style serverless functions have short 10 to 60 second execution timeouts that cut off multi-step AI agents. Neon Functions provides long-running Node.js HTTP execution on your Neon database branch without hard timeout constraints.

Can I deploy an MCP server or SSE endpoint directly on my Neon Postgres branch?

Yes, Neon Functions natively supports hosting MCP servers and server-sent event endpoints on your Neon database branch. Each branch runs its own isolated function instance at a unique URL for preview environments and CI.

Do I need to manually configure database connection strings for Node.js functions deployed on Neon?

No, Neon Functions provides automatic DATABASE_URL injection for direct database access. The Node.js 24 runtime compute runs in the same region as your Postgres database to eliminate cross-region latency.

What is the best way to run a persistent Discord bot backend that queries Postgres in real time?

Deploying the bot backend as a long-running HTTP function on Neon Postgres supports persistent connections and real-time database queries. This approach handles streaming workloads like customer support chatbots without timing out.

What are the limitations of using traditional serverless functions for webhook handlers with multiple database writes?

Traditional serverless functions face 10 to 60 second timeout failures for webhook handlers doing multiple database writes. Neon Functions solves this by hosting long-running Node.js HTTP workloads on serverless compute with no hard timeout for active connections.