⏱️Scheduling
Task, occurrence, and Execution
What is the difference between a Task, an occurrence, and an Execution?
A Task owns reusable operation/input metadata, reserve funding, controller authority, and one Schedule. An Occurrence is one permanent scheduling opportunity under that Task. Dispatch creates an Execution, which records runtime walks, results, failures, and payment locks. Return to the occurrence for settlement and refund accounting.
How do I run work immediately?
Immediate work is a Task occurrence whose start time is the current Sui Clock:
nexus task schedule \
--dag-id <object-id> \
--input-json '{ ... }' \
--prepay-amount-mist <mist> \
--occurrence-budget-mist <mist> \
--nowFor a registered Agent skill, replace --dag-id with --agent-id <object-id> --skill-id <u64>. Add --agent-funded when the Agent vault should fund and control the Task.
How do I schedule delayed or recurring work?
Use nexus task schedule for atomic creation plus a complete schedule, or create an empty Task and compose it with the nested commands:
nexus task create --dag-id <object-id> --input-json '{ ... }' --prepay-amount-mist <mist> --occurrence-budget-mist <mist>
nexus task occurrence add --task-id <object-id> --after-ms 30000 --deadline-after-ms 60000 --priority-fee-percentage 20
nexus task recurrence set --task-id <object-id> --after-ms 3600000 --interval-ms 3600000 --occurrences 24 --priority-fee-percentage 20The retired nexus scheduler and nexus tap schedule-task command families do not exist in the pinned CLI.
What recurrence shapes exist?
A Schedule contains standalone occurrences and at most one recurrence. The recurrence has a first occurrence, interval, optional maximum count, optional dispatch deadline, priority-fee percentage, and no-overlap policy enforced by Task state. Clear future recurring work with nexus task recurrence clear.
How does priority work?
Each occurrence stores priority_fee_percentage. Eligible work is ordered using that percentage, and settlement calculates priority compensation from payable leader gas. The scheduler has no per-gas-unit field or default-zero mode.
Who can mutate a Task?
Address-controlled operations require the active signer to match the immutable controller. Agent-controlled operations supply and verify the controlling Agent. A TaskPointer is owned discovery metadata used by nexus task list; owning or transferring it does not grant mutation authority.
How do I observe and recover work?
Timeout boundary: Check the installed command’s
--helpbefore using any timeout or abort action. The timeout/refund path must identify the exactinvocation_id; a ToolCashier ID, FQN, or historical cashier-assisted flag is not a safe substitute. An Invocation refund or Execution abort does not necessarily settle its owning Occurrence.
Settle a finished runtime with
nexus task occurrence settle.Record an advertised occurrence as missed after its deadline with
nexus task occurrence expire.Abort runtime after its workflow timeout with
nexus task occurrence abort-expiredonly when the selected build’s--helpexposes the supported arguments and exact object identity.Pause or resume future dispatch with
nexus task pauseandnexus task resume.Refill reserve with
nexus task refill, cancel future work withnexus task cancel, and close only after no advertised, pending, or in-flight occurrences remain. When timeout/refund leaves the Occurrence unsettled, use the selected build’s supported occurrence-settlement action, then re-readSettledand prove zero pending/in-flight work before closing.
Where do I go next?
Payments — reserve custody and refunds.
Authorization — Agent and vertex authorization.
DAG and Execution — the Leader dispatch role and execution transitions.
Schedule an asset-management flow — the recurring-Task walkthrough.
nexus taskandnexus execution— exact flags and output.
Last updated

