Workflow engine and durable schedules
The model writes bounded orchestration scripts; schedules deliver future reminders as normal follow-ups to the same session
worker-thread script + agent() fan-out + durable wakeupWhy can workflow, job, and schedule not collapse into one background-task concept?
A workflow is the director's shooting plan, a job is the live camera status, and a schedule is the future call sheet that restarts work.
Mechanism
Each context has one ctx.workflowEngine implementation. worker-thread runs model code in an isolated VM with agent(), phase(), JSON args, and total/concurrency limits.
Schedules persist after/at/every records inside one session and deliver due reminders as ordinary followups. Repetition is fixed-rate, at least five minutes, and missed intervals collapse to the latest due occurrence.
Submit script and meta
Plain-JSON identity and args are schema-validated first.
What extensions must preserve
- Workflow result never rejects; it settles with a closed stopReason
- Dispose force-terminates a stuck worker after bounded grace
- Schedule never implicitly reads environment time zone
The tempting wrong turns
- ×Evaluating workflow meta as code
- ×Replaying every missed schedule interval into a storm
- ×Treating dispatch as user acknowledgement
Do not trust the conclusion—verify it
These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.
Pause for ten seconds before revealing
Why must Schedule at strings include a UTC offset?
The system still needs external capability discovery. Skills, MCP, LSP, and Web enter through distinct seams rather than bypassing the tool pipeline.