Also available: Markdown version · llms.txt · full site content
Storage
Object events
Every committed object change records a durable, versioned event in the project database. CubiBase Functions can subscribe to these events through storage triggers.
The event contract
Three event types are defined: storage.object.created, storage.object.updated, and storage.object.deleted. Each event is schemaVersion 1 and carries identity and metadata — never file contents or credentials.
{
"schemaVersion": 1,
"eventId": "3f7a…",
"eventType": "storage.object.created",
"projectId": "4c8d…",
"bucketId": "a11b…",
"objectId": "9b1e…",
"path": "images/mika.png",
"sizeBytes": 182344,
"mimeType": "image/png",
"actorId": "user_mika",
"source": "storage-api",
"correlationId": "f2c6…",
"timestamp": "2026-11-20T10:05:00.000Z"
}| Field | Meaning |
|---|---|
eventId | Unique id; consumers deduplicate on it |
projectId / bucketId / objectId | The exact identities involved |
path / sizeBytes / mimeType | Logical path and verified metadata |
actorId / source | Who made the change: user id or null; storage-api, console, edge-function, or system |
correlationId | Ties the event to the upload session or request |
timestamp | ISO-8601 commit time |
Durability and delivery
- Events are written to a transactional outbox in the same database transaction as the catalog change — an event exists if and only if the change committed.
- A failed or expired upload never emits a creation event.
- Delivery is at-least-once with retries and exponential backoff; exhausted retries land in a queryable dead-letter state, never silently discarded.
- Consumers must be idempotent on
eventId. The schema is versioned so future fields (causation, invocation depth) can be added without breaking consumers.
Processing events with CubiBase Functions
CubiBase Functions subscribe to these events through storage triggers configured in the Console — pick a bucket, the event types (created, updated, deleted), and an optional key prefix. The event is delivered asynchronously after the storage operation commits, with at-least-once semantics, retries, and dead-letter handling. The handler contract and a working example are on the Storage event functions page.
Functions read source objects and write derived objects through the scoped CubiBase Storage API with a short-lived, single-invocation credential. Function-created objects count toward the same project and account quotas through the same service, and processing traffic is distinguished from external delivery without creating an accounting bypass. Recursion is bounded by invocation-depth tracking: events caused by a function carry causationId and a depth counter, and chained function-triggered executions stop at a fixed maximum depth.
Typical scenarios: generate image thumbnails on upload, process PDFs into derived files or application data, and run scheduled cleanup of expired files — all through the same authorization and quota machinery as any other client. The Image Processing and Scheduled Cleanup templates start from working code.