Little programs.
Long attention spans.
Tiny programs. Hours, days, or a human reply.
Save a few
kilobytes of state. Wake on a timer, an answer, or a webhook.
Yes, even after you close this tab.
Give an idea a life of its own.
REAL CODE. REAL EXECUTION. A LITTLE MAGIC.A human is the trigger. The program keeps its draft until you choose what happens next.
Your runs
printsleepaskaifetchJsonkv
await sleep(Infinity)Just a dream. Try a finite nap.
Big things happen.
Even in the pauses.
Run a workflow. Close the tab.
The next event picks up the
story.
Anyone with this URL or run link can send this event. No external service is connected automatically.
Send a test event or use curl
Execution details timing, saved state & system events
Don’t keep a computer running
just to wait for life to happen.
The program stops.
The story doesn’t.
An hour of waiting shouldn’t need an hour of running.
Do the work.
const name = "Ada"
print("See you soon, " + name)
await sleep(3600000)
Keep the bookmark.
Pick up here.
// Same name. Next line. print("Welcome back, " + name) › Welcome back, Ada
JavaScript you can put down and pick up.
Psychoscript preserves variables, the call stack, and execution position. A small execution snapshot—not a whole V8 isolate, container, or virtual machine.
A durable home on Cloudflare.
Our runner adds durable storage, alarms, and signal-driven wake-ups on Cloudflare. Our host functions add choices, webhooks, and Workers AI. No Worker stays running just to wait; storage still has a cost.
A thousand waiting programs.
Not a thousand waiting computers.
Keep the thought. Release the execution. See what changes as the wait gets longer.
Same workflow. A very different shape.
A held-open execution spans the entire wait. A saved program only executes at the ends; its state persists between them.
Execution bursts are widened to be visible. This is a workflow diagram, not a concurrency benchmark.
What does that wait cost?
USD · selected components for one batchLinear cost scale; subpixel values are marked with a dot. Rate-equivalent illustration, not a total bill.
Ordinary Workers do not charge CPU for I/O waiting. A Durable Object that already hibernates also avoids idle-duration charges. The advantage here is preserving your JavaScript execution without keeping it open.
Rates, assumptions & what’s excluded
Paid overage rates checked December 3, 2026: Worker CPU $0.02 / million CPU-ms; SQLite storage $0.20 / GB-month; resident Durable Object duration $12.50 / million GB-s at 0.125 GB per object. Storage uses decimal GB and a 30-day month. The 6,255-byte snapshot comes from our one-hour example; actual programs vary.
Before included allowances and billing-unit rounding. Excludes plan fees, requests, DO coordination, SQLite reads/writes, metadata, logs, post-completion retention, and model or external API charges. These components are not an apples-to-apples total bill or a provider benchmark.
Sources: Cloudflare Workers pricing ↗ · Durable Objects pricing ↗
Build your own host tools How ask(), webhooks, and agent handoffs fit together
ask() and waitForWebhook() are host
functions we built for this playground. Psychoscript provides the
interpreter and resumable execution. You provide the capabilities:
email, a renderer, an agent, or a model.
sendEmail: ps.Host.fn(async ([to, body], call) => {
return mail.send({ to, body, idempotencyKey: call.key })
}, { type: "async", idempotent: true })
mail is your provider integration. The script can
call sendEmail(); you control its implementation,
credentials, and allowed recipients. Use a provider that honors
the idempotency key so retries are safe.
With the runner library, park on
await waitFor("render.done"), then deliver the
payload from your webhook handler:
await runner.client(env).signal(runId, "render.done", payload, { background: true })
If a provider only supports polling, use
fetchJson() and sleep() in a loop. Each
wait persists the program without maintaining a connection. Use
idempotency keys for external side effects that might be replayed.