golemcloud/golem/golem-add-webhook-go
- community
Checking that the SKILL.md file is still in the repository.
Receiving external webhook callbacks in a Go Golem agent. Use when the user asks to create webhooks, receive webhook callbacks, integrate with webhook-driven external APIs, or generate temporary callback URLs for external services in a Go Golem project.
Install
npx vskill@latest install golemcloud/golem/golem-add-webhook-goSKILL.md
Using Webhooks in a Go Golem Agent
Overview
A Golem webhook lets an agent mint a temporary public URL that an external system POSTs to; the POST body is delivered back to the agent. Under the hood a webhook is a Golem promise. Creation does not suspend the agent. A durable agent awaiting the callback can suspend after the suspension policy delay, freeing guest execution resources while persisted state and other resources remain. The wait survives restarts via oplog replay.
A webhook is a promise completed by an HTTP POST:
golem.NewWebhook[T]()creates the promise and the URL that completes it;w.URL()is the URL to hand out.w.ID()returns thegolem.PromiseIDto persist in agent state.golem.PromiseByID[T](id).MustAwait()(orw.MustAwait()) suspends until the POST arrives and returns the body decoded asT;Await()returns(T, error)instead.
This is useful for payment gateways, CI/CD, GitHub/Stripe callbacks, and any event-driven workflow where an external system notifies the agent.
Prerequisites
The agent type must have an HTTP mount (Spec.HTTP = &golem.Mount{Path: "/..."}) and be deployed via an httpApi deployment in golem.yaml. Without that, NewWebhook traps (it is fail-loud). The mount does not need any HTTP endpoints — it only makes the agent HTTP-API-deployable.
Steps
- Add an HTTP mount to the agent's
Spec(seegolem-add-http-endpoint-go). - Create a webhook; persist its
PromiseIDin state and return/share the URL. - Await the callback in a later invocation via the stored id.
- Deploy behind an
httpApiso the URL is reachable.
API
| Function / method | Description | |
|---|---|---|
golem.NewWebhook[T]() | Create a promise and the public URL that a POST completes; returns *golem.Webhook[T] (a *golem.Promise[T] plus URL()); requires the agent be HTTP-API-deployed | |
(*Promise[T]).WebhookURL() string | Mint the URL for a promise created with golem.NewPromise[T]() | |
(*Promise[T]).ID() golem.PromiseID | The durable id — persist it to await/complete in a later invocation | |
(*Promise[T]).Await() (T, error) | Suspend until completed; returns the POST body decoded as T (JSON, or raw bytes when T is []byte), or an error if it does not decode | |
(*Promise[T]).MustAwait() T | Await that panics if the body does not decode | |
golem.PromiseByID[T](id) | Rebuild a handle from a stored PromiseID | |
golem.CompletePromise[T](id, value) | Complete a promise from another agent (external completers use the URL instead) |
Complete example
Definition (agents/webhookdemo/webhookdemo.go)
Implementation (agents/webhookdemo/impl/impl.go)
Payload decoding
Await() decodes the POST body as its type parameter T via JSON, and returns an error when the body does not decode. Use a struct with json tags (as Event above) for structured payloads, or golem.PromiseByID[[]byte](id).Await() to receive the raw request bytes unchanged.
Webhook URL structure and suffix
The minted URL has the shape https://<domain>/<prefix>/<suffix>/<id>:
<domain>— where the HTTP API is deployed.<prefix>— defaults to/webhooks, customizable viawebhookUrlin thehttpApideployment section ofgolem.yaml.<suffix>— defaults to the agent type name in kebab-case; override it withMount.WebhookSuffix.<id>— a unique per-webhook identifier.
Key Constraints
- The agent must set
Spec.HTTPand be deployed viahttpApi, orWebhookURL()panics, which traps the component, as in Rust. - Only the agent that created the promise may
Awaitit; awaiting from another agent traps in the host. - Only a
POSTto the URL completes the promise. Completion is first-write-wins: duplicate POSTs return HTTP 204 without replacing the first payload. Completion does not immediately invalidate the URL, and a laterAwaitreturns the recorded body from the oplog. - A durable agent can suspend after the suspension policy delay while awaiting — it survives failures, restarts, and updates.
- Go difference from Rust:
Mount.WebhookSuffixmust be literal segments only — path variables like{agent-type}or{name}in the suffix are rejected in the Go SDK. Rust supports system variables such as{agent-type}and{agent-version}, not constructor parameters such as{name}.
Related Skills
| Skill | When to Load | |
|---|---|---|
golem-add-http-endpoint-go | Set up the HTTP mount + httpApi deployment webhooks require | |
golem-add-agent-go | Define the agent and its payload types | |
golem-add-http-auth-go | Require authentication on the agent's other endpoints |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggolem-skills/skills/go/golem-add-webhook-go/SKILL.md
Popularity
- Repository stars
- 1,514
- Repository forks
- 210
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/golemcloud/golem/golem-add-webhook-go)