What problem does it solve?
Receiving asynchronous callbacks from external services (payment gateways, CI/CD systems, GitHub, Stripe) inside a durable agent is hard to coordinate. This Skill shows how to generate a temporary public webhook URL in a MoonBit Golem agent, durably suspend while waiting, and decode the incoming POST payload.
Core Features & Use Cases
- Webhook Creation: Use
@webhook.create() to generate a promise-backed public URL and share it with external systems.
- Durable Waiting:
WebhookHandler::wait() suspends the agent without consuming resources until the callback arrives, surviving restarts and updates.
- Payload Decoding: Read the callback body as UTF-8 text via
WebhookRequestPayload::text() or as raw bytes via bytes().
- URL Customization: Configure webhook prefixes in
golem.yaml (webhookUrl) and suffixes via #derive.mount_webhook, including path variables.
- Use Case: Build an integration agent that registers a callback URL with a payment provider, waits for the payment confirmation POST, and stores the event for later retrieval.
Quick Start
Add a webhook to my MoonBit Golem agent that creates a callback URL, waits for an external POST, and stores the received payload.