Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 7 min read Announcement mediumAdept

When a file is uploaded, run the job on Neon

Neon added a storage_object_created function trigger that invokes a Neon Function via HTTP POST when an object is created in a Neon Object Storage bucket, optionally filtered by key prefix. The payload carries the bucket name and object key. Functions are long-running and scale to zero, and they wake Postgres compute on demand. Example pipelines include cataloging uploads in Postgres, generating image variants under a separate prefix to avoid self-triggering, AI tagging, PDF chunking and embedding for search, and moderation, which runs after the upload lands and so cannot block it. Triggers branch with the data but are disabled by default on child branches, and they can be declared in a neon.ts config file alongside buckets and functions.

Related posts

  • Add files to your branches

    Neon mediumAdept

    Neon Object Storage is an S3-compatible store whose buckets belong to database branches: child branches inherit buckets and objects via the same copy-on-write model as Neon Postgres, so previews get isolated, unbilled-until-diverged copies of production files. Branch reset restores buckets along with the database, but instant restore only rolls back Postgres. Migration mostly means repointing S3 clients at the branch endpoint with path-style addressing, with limits such as no bucket notifications, lifecycle rules, ACL writes or objects over 10 GiB. Function Triggers fire Neon Functions on object creation or on a cron schedule, and inherited triggers start disabled on child branches to avoid reprocessing.

  • Neon Functions: backend logic next to your data

    Neon mediumAdept

    Neon Functions are long-running Node.js 24 compute deployed onto a Neon branch, in the same region and on the same infrastructure as its Lakebase Postgres database, with DATABASE_URL and other Neon backend credentials injected automatically. Running next to the data removes the cross-network hop per query and lets a function keep a pg Pool open across requests, so agents can stream for minutes and WebSockets or SSE can fan out via Postgres LISTEN/NOTIFY. Functions branch with the database: each child branch gets its own function copy and URL, and deleting the branch deletes it. They are declared in neon.ts, Hono is the recommended framework, and the pg Pool is recommended over the serverless driver; functions are not for frontend hosting or background jobs, and cron and event triggers are planned.

  • Postgres Event Triggers Are Now Supported in Neon

    Neon mediumAdept

    Neon now supports Postgres event triggers through the neon_superuser role, and they behave exactly as in vanilla Postgres. Unlike row-level triggers, event triggers fire on DDL commands such as CREATE, ALTER and DROP. They can audit schema changes on ddl_command_end, automate metadata updates or alerts, and feed schema changes to sync engines like Zero via pg_event_trigger_ddl_commands(). Short examples show blocking DROP TABLE for non-admin roles and cleaning up orphaned pg_cron jobs on sql_drop using pg_event_trigger_dropped_objects().

  • Building Neon Object Storage

    Neon easyNovice

    Neon Object Storage is an S3-compatible object store whose buckets and objects branch together with a Neon Postgres database under one shared branch_id, so a child branch inherits files at the fork point with copy-on-write isolation. Postgres branches via the pageserver's page-level copy-on-write. Object Storage uses its own lineage-and-versioning scheme: each branch stores an ordered lineage back to root, every write adds a versioned row, lookups walk the lineage, and deletes on a child write a tombstone version without touching the parent. Branch creation is a single write regardless of data size, and storage cost only grows as branches diverge. Access is through the standard S3 wire protocol with Neon credentials, with bucket visibility managed in Neon rather than S3 ACLs and provisioning declared in neon.ts.

  • Your Neon Functions can now run on a schedule

    Neon mediumAdept

    Neon Function Triggers let Neon invoke a deployed Node.js function on a cron schedule. Because the timer lives outside the Postgres compute, scheduled jobs keep working with scale to zero, unlike pg_cron, which only runs while the compute is up and can only execute SQL. Triggers are branch-scoped, and child branches inherit their parent's triggers in a disabled state, so branching production doesn't double-fire jobs. A worked example uses a Hono handler that verifies the X-Neon-Trigger-Invocation-Id header, reads scheduled_at from the request body, and uses ON CONFLICT DO NOTHING to stay idempotent, plus the API call that creates a 15-minute schedule.

The quest for software engineering knowledge.

Look:
Layout: