NeonCarlota Soto5 min readintermediate
Neon Functions: backend logic next to your data
Summary
Neon Functions are server‑less Node.js 24 compute that run on the same branch and region as Neon’s Lakebase Postgres, giving low‑latency DB access, long‑running connections for agents/WebSockets, automatic credential injection, and branch‑aware deployment via neon.ts. They’re meant for data‑adjacent backend logic, not full‑stack hosting, and future plans include native cron and event triggers.
- Functions execute in the same infra and region as the Neon branch, eliminating cross‑network round‑trips for every query.
- A long‑running runtime (no Lambda‑style caps) lets agents stream for minutes and keeps WebSocket/SSE connections open.
- Neon automatically injects DATABASE_URL and other backend credentials (Object Storage, AI Gateway, Auth) into the function’s environment.
- Functions are branch‑aware: creating a child branch clones the function with its own URL and DB connection, and deleting the branch removes the function.
Running backend logic next to the database cuts latency and connection overhead, which is critical for AI agents, real‑time apps, and any workload that streams data or holds long‑lived connections. Branch‑level isolation also aligns backend code with Neon’s core branching model, simplifying preview…
6/10





