Serverless workers
Deploy workers to serverless platforms (Lambda, Cloud Functions, etc).
Currently only the TypeScript SDK supports serverless worker shims.
What is a serverless worker shim?#
A serverless worker shim, also referred to as a binding, is a lightweight adapter that allows Resonate Workers to run in serverless (FaaS) environments such as Cloudflare Workers, AWS Lambda, Google Cloud Functions, etc. The shim handles the communication between the Resonate SDK and the serverless platform, allowing you to run long-running workflows in ephemeral serverless functions with relative ease.
Supported platforms#
The following serverless platforms are supported with official Resonate worker shims:
AWS Lambda#
Amazon Lambda worker shim | TypeScript
Quick example:
npm install @resonatehq/awsInstead of importing Resonate from the SDK package, import it from the AWS shim package.
import { Resonate } from "@resonatehq/aws";
import { countdown } from "./count";
const resonate = new Resonate();
resonate.register("countdown", countdown);
export const handler = resonate.httpHandler();Cloudflare Workers#
Cloudflare Workers worker shim | TypeScript
Quick example:
npm install @resonatehq/cloudflareInstead of importing Resonate from the SDK package, import it from the Cloudflare shim package.
import { Resonate } from "@resonatehq/cloudflare";
import { countdown } from "./count";
const resonate = new Resonate();
resonate.register("countdown", countdown);
export default resonate.handlerHttp();Ready to use example apps:
- Durable Counter with Cloudflare Workers | TypeScript
- Deep Research Agent with Cloudflare Workers | TypeScript
Google Cloud Functions#
Google Cloud Functions worker shim | TypeScript
Quick example:
npm install @resonatehq/gcpInstead of importing Resonate from the SDK package, import it from the GCP shim package.
import { Resonate } from "@resonatehq/gcp";
import { countdown } from "./count";
const resonate = new Resonate();
resonate.register("countdown", countdown);
export const handler = resonate.handlerHttp();Ready to use example apps:
Supabase Edge Functions#
Supabase Edge Functions worker shim | TypeScript
Quick example:
npm install @resonatehq/supabaseInstead of importing Resonate from the SDK package, import it from the Supabase shim package.
import { Resonate } from "@resonatehq/supabase";
import { countdown } from "./count";
const resonate = new Resonate();
resonate.register("countdown", countdown);
resonate.httpHandler();Ready to use example apps: