Two tiny Cloudflare loop experiments behind one Worker:
do: a Durable Object alarm that calls back into the Worker through a loopback binding.workflow: a Workflow that drains the same shape of KV queue withstep.do()andstep.sleep().
Tasks live in KV. Each tick claims one task and records a result.
TODO: see it get done. The POC stops at claim + log. Running Codex CLI needs an external runner.
POST /tasks?driver=doPOST /tasks?driver=workflowPOST /do/startPOST /do/stopGET /statusPOST /workflow/startGET /workflow/:id
bun run dev
curl -X POST http://127.0.0.1:8787/tasks?driver=do \
-H 'content-type: application/json' \
-d '{"prompt":"Open todo.md. Pick the first unchecked item. Make the smallest valid patch."}'
curl -X POST http://127.0.0.1:8787/do/start \
-H 'content-type: application/json' \
-d '{"everyMs":5000}'
curl http://127.0.0.1:8787/statuscurl -X POST http://127.0.0.1:8787/tasks?driver=workflow \
-H 'content-type: application/json' \
-d '{"prompt":"Read failing CI logs. Draft the smallest fix. Stop when tests pass."}'
curl -X POST http://127.0.0.1:8787/workflow/start \
-H 'content-type: application/json' \
-d '{"everyMs":5000,"maxTicks":4}'