You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cron jobs run in the session they were created from unless the job explicitly requests an isolated fresh session.
Co-authored-by: Peter Steinberger <[email protected]>
| Current session |`current`|Bound at creation time| Context-aware recurring work|
95
+
| Custom session |`session:custom-id`|Persistent named session | Workflows that build on history|
96
96
97
97
<AccordionGroup>
98
98
<Accordiontitle="Main session vs isolated vs custom">
99
-
**Main session** jobs enqueue a system event into a cron-owned run lane and optionally wake the heartbeat (`--wake now` or `--wake next-heartbeat`). They can use the target main session's last delivery context for replies, but they do not append routine cron turns to the human chat lane and do not extend daily/idle reset freshness for the target session. **Isolated** jobs run a dedicated agent turn with a fresh session. **Current** and **custom** session jobs (`current`, `session:xxx`) can use the selected chat/session for delivery context and safe preference seeding, but each run still executes in a detached cron session so scheduled work does not block or pollute the live conversation transcript.
99
+
**Main session** jobs enqueue a system event into a cron-owned run lane and optionally wake the heartbeat (`--wake now` or `--wake next-heartbeat`). They can use the target main session's last delivery context for replies, but they do not append routine cron turns to the human chat lane and do not extend daily/idle reset freshness for the target session. **Isolated** jobs run a dedicated agent turn with a fresh session. **Custom sessions** (`session:xxx`) persist context across runs, enabling workflows like daily standups that build on previous summaries.
100
100
101
101
Main-session cron events are self-contained system-event reminders. They do
102
102
not automatically include the default heartbeat prompt's "Read
@@ -105,8 +105,8 @@ This fires ~5–6 times per month instead of 0–1 times per month. OpenClaw use
105
105
agent's own instructions.
106
106
107
107
</Accordion>
108
-
<Accordiontitle="What 'fresh session' means for detached jobs">
109
-
For isolated, current-session, and custom-session jobs, "fresh session" means a new transcript/session id for each run. OpenClaw may carry safe preferences such as thinking/fast/verbose settings, labels, and explicit user-selected model/auth overrides. Detached runs do not inherit ambient conversation context from an older cron row: channel/group routing, send or queue policy, elevation, origin, or ACP runtime binding. Put durable recurring-work state in the prompt, workspace files, tools, or the system the job operates on rather than relying on a live chat transcript as cron memory.
108
+
<Accordiontitle="What 'fresh session' means for isolated jobs">
109
+
For isolatedjobs, "fresh session" means a new transcript/session id for each run. OpenClaw may carry safe preferences such as thinking/fast/verbose settings, labels, and explicit user-selected model/auth overrides, but it does not inherit ambient conversation context from an older cron row: channel/group routing, send or queue policy, elevation, origin, or ACP runtime binding. Use `current` or `session:<id>` when a recurring job should deliberately build on the same conversation context.
110
110
</Accordion>
111
111
<Accordiontitle="Runtime cleanup">
112
112
For isolated jobs, runtime teardown now includes best-effort browser cleanup for that cron session. Cleanup failures are ignored so the actual cron result still wins.
Copy file name to clipboardExpand all lines: docs/automation/taskflow.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Use Task Flow when work spans multiple sequential or branching steps and you nee
25
25
For recurring workflows such as market intelligence briefings, treat the schedule, orchestration, and reliability checks as separate layers:
26
26
27
27
1. Use [Scheduled Tasks](/automation/cron-jobs) for timing.
28
-
2.Store prior context in the workflow's own files, database, or tool state.
28
+
2.Use a persistent cron session when the workflow should build on prior context.
29
29
3. Use [Lobster](/tools/lobster) for deterministic steps, approval gates, and resume tokens.
30
30
4. Use Task Flow to track the multi-step run across child tasks, waits, retries, and gateway restarts.
31
31
@@ -43,7 +43,7 @@ openclaw cron add \
43
43
--to "channel:C1234567890"
44
44
```
45
45
46
-
Use `session:<id>` when the job should target a known chat/session for delivery context or safe preference seeding. Cron still executes each run in a detached session, so put previous run summaries and standing workflow state in explicit storage the job can read.
46
+
Use `session:<id>`instead of `isolated`when the recurring workflow needs deliberate history, previous run summaries, or standing context. Use `isolated` when each run should start fresh and all required state is explicit in the workflow.
47
47
48
48
Inside the workflow, put reliability checks before the LLM summary step:
0 commit comments