Open Function Standard
The Open Function Standard (OFS) is a specification for writing portable backend functions. An OFS function declares its dependencies (database, cache, AI, etc.) in a manifest — the runtime provides them. The same function runs on Cloudflare Workers, Node.js, Bun, or Deno without modification.
The problem OFS solves
Section titled “The problem OFS solves”When you write a backend function today, it’s tightly coupled to your platform:
// Platform-specific: only works on Cloudflare Workersexport default { async fetch(request, env) { const db = env.DB const result = await db.prepare('SELECT * FROM users WHERE id = ?') .bind(userId) .first() return Response.json(result) }}Move this to Node.js or Bun? Rewrite everything.
The OFS approach
Section titled “The OFS approach”An OFS function declares what it needs. The runtime injects it:
// OFS function — runs on any supported runtimeexport default async function getUser({ userId }, { sdk }) { const user = await sdk.db.queryOne('SELECT * FROM users WHERE id = ?', [userId]) return { user }}The sdk argument is injected by the OFS runner. On the edge, it uses the native database binding. On Node.js, it uses a compatible adapter. The function is identical.
OFS manifest
Section titled “OFS manifest”Every OFS function has an aerostack.json manifest:
{ "name": "get-user", "version": "1.0.0", "description": "Fetch a user by ID", "runtime": "workers", "inputs": { "userId": { "type": "string", "required": true } }, "outputs": { "user": { "type": "object" } }, "requires": ["db"], "auth": "required"}| Field | Description |
|---|---|
name | Unique function identifier |
version | Semantic version |
runtime | Target runtime: workers, node, bun, deno, any |
inputs | Input schema (validated before execution) |
outputs | Output schema (validated after execution) |
requires | SDK capabilities needed: db, cache, ai, storage, queue, realtime |
auth | Authentication requirement: required, optional, none |
Supported runtimes
Section titled “Supported runtimes”| Runtime | Status |
|---|---|
| Cloudflare Workers | ✓ Stable |
| Node.js 20+ | ✓ Stable |
| Bun | ✓ Stable |
| Deno | Beta |
| Python | Beta (via generated SDK) |
Why this matters
Section titled “Why this matters”- Publish once — share a function in the Community Hub that any project can use
- No vendor lock-in — your functions aren’t tied to one cloud
- Testable — run functions locally with mock SDK injections
- Composable — functions call other functions, building complex pipelines from simple pieces
Next steps
Section titled “Next steps”- Writing OFS Functions — step-by-step guide with examples
- Publishing to the Hub — share your functions with the community