What problem does it solve?
Golem agents have no built-in cron scheduler, so developers need a durable way to run periodic work such as polling, cleanup, and heartbeats that survives agent crashes and restarts.
Core Features & Use Cases
- Self-Scheduling Pattern: The agent calls
.poll.scheduleAt(...) on its own remote client to enqueue the next run, creating a durable recurring loop.
- Exponential Backoff: Increase the delay between runs on repeated failures and reset it on success, capped at a maximum interval.
- Cancellation Options: Stop the loop with a
CancellationToken from scheduleCancelableAt, a simple state flag, or the Golem CLI using an idempotency key.
- Use Case: An agent polls an external API every 60 seconds for pending items, processes them, and schedules its next invocation; if the agent crashes, the pending scheduled invocation still fires after recovery.
Quick Start
Ask the AI to implement a recurring polling task in a Scala Golem agent that schedules its own next invocation every 60 seconds using scheduleAt.