What problem does it solve?
Long-running agents often need to pause until an external event occurs—a human approval, a webhook callback, or a signal from another agent. Polling wastes resources and naive blocking loses state on failure. This Skill shows how to use Golem promises in Scala to durably suspend an agent, consuming no resources, until external data arrives.
Core Features & Use Cases
- Promise Lifecycle API: Create promises with
HostApi.createPromise, await them with blocking or Future-based calls, and complete them from other agents or external systems.
- Typed JSON Variants: Use
awaitPromiseBlockingJson and completePromiseJson with zio.blocks.schema.Schema to exchange structured data instead of raw bytes.
- REST Completion Endpoint: Expose the promise's
oplogIdx so external systems can complete it via the Golem REST API.
- Use Case: Build a human-in-the-loop approval workflow where an agent creates a promise, suspends until a reviewer approves or rejects via an HTTP call, then resumes with the decision.
Quick Start
Ask the AI to implement a Scala Golem agent that creates a promise, waits for an external approval decision, and resumes the workflow with the result.