golem-add-webhook-rust

Creates temporary webhook URLs in Rust Golem agents to receive external HTTP callbacks.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-add-webhook-rust
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golem-add-webhook-rust
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/rust/golem-add-webhook-rust
Command: npx skills add https://github.com/golemcloud/golem --skill golem-add-webhook-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Receiving asynchronous callbacks from external services (payment gateways, CI/CD systems, GitHub, Stripe) inside a durable Golem agent normally requires manual promise handling and public URL plumbing. This Skill shows how to generate a temporary public webhook URL, share it with an external system, and durably suspend the agent until the callback arrives.

Core Features & Use Cases

  • Webhook Creation: Use create_webhook() from the golem_rust crate to create a promise-backed webhook and obtain its public URL via WebhookHandler::url().
  • Durable Suspension: Await the WebhookHandler to suspend the agent with zero resource consumption until an external service POSTs to the URL.
  • Payload Decoding: Decode the incoming POST body as JSON with WebhookRequestPayload::json::<T>() or access raw bytes with raw_data().
  • URL Customization: Configure webhook URL prefixes via webhookUrl in golem.yaml and suffixes via webhook_suffix on #[agent_definition].
  • Use Case: Build an order agent that registers a callback URL with a payment gateway, suspends until the payment confirmation POST arrives, then records the event.

Quick Start

Add a webhook to my Rust Golem agent that creates a callback URL, waits for an external service to POST a JSON event to it, and stores the received payload.

Frequently Asked Questions about golem-add-webhook-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I receive webhook callbacks in a Rust Golem agent?▼

Call create_webhook() from the golem_rust crate to get a WebhookHandler, share its url() with the external service, then await the handler. The agent durably suspends until a POST arrives, and you decode the body with payload.json::<T>() or raw_data().

How to customize the webhook URL path in Golem?▼

Set webhookUrl in the httpApi deployment section of golem.yaml to change the URL prefix, which defaults to /webhooks. Use the webhook_suffix attribute on #[agent_definition] to override the default kebab-case agent name in the path, including path variables in braces.

Does Golem webhook creation require an HTTP API mount?▼

Yes, the agent type must be deployed via an HTTP API mount using the mount attribute on #[agent_definition] and an httpApi deployment in golem.yaml. Without a mount, webhooks cannot be created because there is no public endpoint to receive the callback.

Can a Golem webhook URL be used more than once?▼

No, each webhook URL is one-time-use. Once an external service POSTs to it, the underlying promise completes and the URL becomes invalid. Only POST requests complete the promise; other HTTP methods do not trigger it.

What happens to a Golem agent while waiting for a webhook?▼

The agent is durably suspended and consumes no resources while awaiting the webhook callback. It survives failures, restarts, and updates, resuming execution when the external POST completes the underlying promise.