Serverless functions that actually work together. Build scalable applications with direct service communication, automatic scaling, and zero server management overhead.
Choose the right service type for your needs
Your application's front door
Public services are accessible via unique URLs and handle external requests. Perfect for APIs, webhooks, and user-facing functionality.
service "my-api" {
domain {
cname = "my-unique-service"
}
}
The secret sauce
Internal services don't need public URLs—they're designed to be called by other services within your application using direct method calls.
service "inventory" {}
service "payments" {}
service "notifications" {}
See how services communicate directly without HTTP overhead
export default class extends Service<Env> {
async fetch(request: Request): Promise<Response> {
// Direct call to internal service
const response = await this.env.SERVICE_B.processData({
userId: getUserId(request)
});
return response;
}
}
export default class extends Service<Env> {
async fetch(request: Request): Promise<Response> {
return new Response("not found", { status: 404 });
}
async processData(input: any): Promise<Response> {
// Your business logic here
return new Response("Processed successfully");
}
}
Structure applications with clear separation between public interfaces and internal business logic
application "store" {
// Public-facing services
service "api" {
domain { cname = "store-api" }
}
service "admin" {
domain { cname = "admin-panel" }
}
// Internal services
service "inventory" {}
service "payments" {}
service "notifications" {}
}
Get all the benefits of microservices without the operational overhead
Each service scales automatically based on demand. No manual capacity planning required.
Deploy services independently. Update one service without affecting others.
Only pay for the compute time your services actually consume. No idle server costs.