golem-add-webhook-moonbit

Creates promise-backed webhooks in MoonBit 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-moonbit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-add-webhook-moonbit
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/moonbit/golem-add-webhook-moonbit
Command: npx skills add https://github.com/golemcloud/golem --skill golem-add-webhook-moonbit

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about golem-add-webhook-moonbit

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

FAQPage Schema
How do I create a webhook in a MoonBit Golem agent?

Call @webhook.create() to get a WebhookHandler, retrieve its public URL with webhook.url(), share that URL with the external service, then call webhook.wait() to block until the POST arrives. Decode the body with payload.text() or payload.bytes().

How do I receive webhook callbacks from external services like Stripe or GitHub?

Create a webhook, register its generated URL as the callback URL with the external service, and wait on the handler. The agent is durably suspended while waiting and resumes when the service POSTs to the URL.

Why is my Golem webhook URL not working?

Webhooks require the agent to have an HTTP mount via #derive.mount and an httpApi deployment in golem.yaml. Also note each webhook URL is one-time-use and only accepts POST requests; after completion the URL becomes invalid.

Can I customize the webhook URL path in Golem?

Yes. Set webhookUrl in the httpApi deployment section of golem.yaml to change the prefix, and use #derive.mount_webhook("/path") on the agent struct to override the default kebab-case agent name suffix, including path variables in braces.

What are the limitations of Golem webhooks?

Each webhook URL is single-use and only completes on a POST request. The agent must be deployed behind an HTTP API mount, and wait() blocks until the callback arrives, though the agent survives failures, restarts, and updates while suspended.