Hey! Is there any way to specify a custom human-readable ID when creating a cron job via cron add? I dug through the source and CronJobCreate doesn't include an id field, and the CLI has no --id flag. Currently working around it by writing directly to jobs.json with a readable string ID before startup (confirmed it loads fine). Just wondering if there's a proper supported path or if this is something worth adding as a feature request.
#custom human-readable ID when creating a cron job
11 messages Β· Page 1 of 1 (latest)
Short version: not through the supported CLI today.
I checked the current docs/help and runtime behavior:
openclaw cron add --helphas no--id- the docs only document
--nameplus schedule/payload flags, not a custom job ID: https://docs.openclaw.ai/cli/cron and https://docs.openclaw.ai/automation/cron-jobs - the cron service generates the job ID internally with a UUID when creating a job
So your jobs.json workaround makes sense because stored jobs do have an id, and the loader will honor it, but I'd treat direct file edits as an internal/unsupported path, not a stable public interface.
One useful distinction: if you mainly want a readable persistent context key, --session "session:daily-brief" is supported, but that only names the session, not the cron job ID itself.
So yes, I think this is worth a feature request. A reasonable shape would be something like:
openclaw cron add --id daily-brief ...
with collision validation and maybe slug rules.
If you want, I can help draft the GitHub issue text.
yes.. can you help me witrh the draft
Yep, here's a clean draft you can paste into GitHub:
Title
cron add: support custom job IDs via --id
Body
## Summary
`openclaw cron add` currently auto-generates a UUID for each job and does not provide a supported way to set a custom human-readable job ID.
## Current behavior
- `CronJobCreate` does not expose an `id` field
- `openclaw cron add --help` has no `--id` flag
- the runtime generates a UUID when creating a job
Cron jobs stored in `~/.openclaw/cron/jobs.json` do appear to honor a manually provided `id`, so the scheduler/store format already seems compatible with string IDs.
## Problem
For users managing multiple cron jobs, UUIDs are hard to work with in:
- `openclaw cron list`
- `openclaw cron edit <id>`
- `openclaw cron run <id>`
- `openclaw cron runs --id <id>`
- config/scripts/docs where jobs are referenced repeatedly
Human-readable IDs would make cron jobs much easier to operate and automate.
## Proposed behavior
Support an optional custom ID at creation time, for example:
```bash
openclaw cron add --id daily-brief ...
Suggested behavior:
--idis optional- if omitted, keep current UUID behavior
- if provided, validate against a safe format (for example slug-like strings)
- reject collisions with an explicit error
- preserve the existing
namefield separately fromid
## Example use cases
```bash
openclaw cron add --id daily-brief --name "Daily Brief" ...
openclaw cron edit daily-brief --no-deliver
openclaw cron run daily-brief
openclaw cron runs --id daily-brief
Current workaround
Right now the only workaround seems to be editing ~/.openclaw/cron/jobs.json directly before startup and supplying a readable id there.
That works, but it feels like an internal/unsupported path rather than an intended interface.