#lobster cron

1 messages · Page 1 of 1 (latest)

lean mason
#

how to make a proper lobstered cron job?

midnight locustBOT
versed etherBOT
#

The clean pattern is:

  1. Standing orders say what to do
  2. Cron says when to do it
  3. Use --session isolated for real jobs, main for simple reminders

Example recurring job:

openclaw cron add \
  --name "daily-lobster-brief" \
  --cron "0 9 * * 1-5" \
  --tz "Europe/Vienna" \
  --session isolated \
  --message "Execute the morning brief per standing orders. Return a short plain-text summary." \
  --announce \
#
  --channel discord \
  --to "channel:<thread-or-channel-id>"

A few “proper cron” rules:

  • use cron for exact timing, use heartbeat if “roughly every 30m” is fine
  • add --tz so it fires when you expect
  • use --exact if you really want top-of-hour exactness
  • keep the cron prompt short, put the durable behavior in AGENTS.md / standing orders
  • for one-shot reminders, use --at "20m" + --session main + --system-event

If you mean an actual Lobster workflow, same idea: cron is just the scheduler, the isolated agent run can invoke the Lobster pipeline.

Docs:

lean mason
#

i want the cron execute .lobster properly

versed etherBOT
#

Yep, the important bit is this:

cron does not run .lobster files directly with a --pipeline flag.
The supported pattern is:

  1. cron schedules an isolated agent turn
  2. that turn must have the lobster tool enabled
  3. the prompt tells the agent to run your .lobster workflow file

1) Enable Lobster first

Lobster is optional, not on by default:

{
  tools: {
    alsoAllow: ["lobster"]
#
  }
}

Docs: https://docs.openclaw.ai/tools/lobster

2) Create the cron as an isolated agent job

openclaw cron add \
  --name "run-my-lobster" \
  --cron "0 9 * * *" \
  --tz "Europe/Vienna" \
  --session isolated \
  --tools lobster \
#
  --message 'Run the Lobster workflow file "/absolute/path/to/my-flow.lobster". Return a short plain-text summary of the result.' \
  --announce \
  --channel discord \
  --to "channel:<thread-or-channel-id>"

3) A few gotchas

  • use an absolute path to the .lobster file if you can
  • if you use --tools, make sure lobster is included
  • for unattended cron, keep the workflow approval-free if possible
    because if Lobster pauses with needs_approval, the cron run won’t finish cleanly on its own

Good mental model

  • cron = scheduler
  • lobster = workflow runtime
  • agent turn = the bridge between them
lean mason
#

"kind": "agentTurn"

should i put it too?

versed etherBOT
#

Nope, not if you’re using openclaw cron add.

--message + --session isolated already makes it an agentTurn job.
--system-event + --session main becomes systemEvent.

So with the CLI, don’t add "kind": "agentTurn" yourself unless you’re manually writing raw cron JSON / calling the RPC directly, which I wouldn’t recommend here.

So the normal version is just:

openclaw cron add \
  --name "run-my-lobster" \
  --cron "0 9 * * *" \
  --tz "Europe/Vienna" \
  --session isolated \
  --tools lobster \
#
  --message 'Run "/absolute/path/to/my-flow.lobster" and return a short summary.' \
  --announce

If you want, paste your full command and I’ll sanity-check it.

lean mason
#

can i put an instruction to use lobster workflow in my agent's heartbeat?

versed etherBOT
#

Yes, absolutely.

A heartbeat is just a periodic main-session agent turn, so if lobster is enabled for that agent, the heartbeat can decide to run a .lobster workflow.

A good pattern is:

If the daily triage is due, run the Lobster workflow "/absolute/path/to/triage.lobster" and return a short summary.
If nothing is due, reply HEARTBEAT_OK.

A few caveats:

  • keep HEARTBEAT.md small , just reference the workflow, don’t paste the whole thing there
  • add a “due” condition or it may run on every heartbeat tick
  • if timing must be exact, cron is better
  • if the Lobster workflow needs approval, heartbeat has the same unattended problem as cron