
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@resonatehq/gcp
Advanced tools
Resonate — empowering serverless and event-driven architectures written as procedural code.
This package enables Google Cloud Platform (GCP) developers to build resilient, event-driven workflows using plain JavaScript or TypeScript — powered by the Resonate Server, which orchestrates execution, state, and communication across functions.
Resonate applications are split into two components:
The GCP SDK (@resonatehq/gcp) connects these workers to the Resonate Server, enabling distributed orchestration without needing a centralized monolith.
+-----------------+ +-------------------------+
| GCP Function | ---> | Resonate Server (Core) |
| (factorial) | <--- | State + Coordination |
+-----------------+ +-------------------------+
npm install @resonatehq/gcp
import { type Context, Resonate } from "@resonatehq/gcp";
const resonate = new Resonate();
function* factorial(ctx: Context, n: number): Generator<any, number, any> {
if (n <= 1) {
return 1;
}
return n * (yield ctx.rpc("factorial", n - 1));
}
resonate.register(factorial);
export const handler = resonate.handlerHttp();
Deploy your function using Google Cloud Functions or Cloud Run:
gcloud functions deploy factorial \
--runtime=nodejs22 \
--entry-point=handler \
--trigger-http \
--allow-unauthenticated
Once deployed, you can trigger workflows using the Resonate CLI:
resonate invoke \
--server https://<resonate-server-url>.com
--func factorial \
--arg 10 \
--target https://<url-for-your-gcp-function>.com
Expected output:
3628800
Resonate uses generator functions to represent workflows.
Each yield is a checkpoint: Resonate persists the state via the Resonate Server and resumes execution when the dependency (RPC, event, etc.) completes.
Key Concepts:
| Concept | Description |
|---|---|
Context | The execution context for a workflow. |
ctx.rpc() | Invokes another registered workflow remotely (via HTTP). The current function suspends and exits; Resonate resumes execution once the remote workflow completes. |
ctx.run() | Executes another function (no need to be registered) locally within the same function. The workflow continues immediately without suspension or remote calls. |
resonate.register() | Register functions for orchestration. |
resonate.httpHandler() | Expose an HTTP endpoint for Cloud Functions or Cloud Run. |
| Platform | Package |
|---|---|
| AWS | @resonatehq/aws |
| Google Cloud | @resonatehq/gcp |
FAQs
Resonate FaaS handler for Google Cloud Functions (TypeScript)
We found that @resonatehq/gcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.