NeonMike Jerome6 min readintermediate
When a file is uploaded, run the job on Neon
Summary
Neon now supports S3‑compatible Object Storage triggers that invoke long‑running Node.js Functions when a new object is created. The trigger sends a POST with bucket and key, letting the Function fetch the file, process it (e.g., catalog, image resizing, AI metadata, PDF indexing, moderation), and write results to Postgres. Triggers are branch‑scoped, work with scale‑to‑zero, and can be defined a…
- Define a `storage_object_created` trigger on a bucket to automatically invoke a Neon Function on object upload.
- The Function receives a JSON payload with `bucket_name` and `object_key`, can fetch the object, run arbitrary jobs, and write to Postgres.
- Functions are long‑running and compatible with Neon’s scale‑to‑zero compute; they can wake a paused Postgres instance.
- Triggers inherit across branches but are disabled by default on child branches, enabling safe testing.
Eliminates the need for external polling or custom webhook services to react to file uploads, tightly coupling storage, compute, and the database within the same region and branch. This reduces latency, simplifies architecture, and leverages Neon’s serverless scaling model for data‑driven pipelines.
6/10





