OptionalresumeArbitrary JSON state saved by the agent when going to sleep and restored into the conversation/payload when the routine wakes.
Optionalwake3-Tier Wake Condition Gate evaluated in order of increasing cost:
SafeExpressionEvaluator boolean expression (0 tokens)AIDecisionRunner (~100 tokens)MJ: AI Prompts evaluation via AIPromptRunnerOptionalforceWakeAfterMinutes?: numberOptional maximum minutes of silence before forcing a wake even if watched entities
are unchanged (e.g. 480 for an 8-hour heartbeat).
OptionalskipIfUnchanged?: booleanWhen true, skips target execution if watched entities and signals have not changed
since LastCheckedAt AND any forceWakeAfterMinutes deadline has not elapsed.
Optionaltier1Expression?: stringTier 1: Deterministic boolean expression evaluated by SafeExpressionEvaluator
against { deltas, totalChangedCount, elapsedMinutes, isScheduledWakeTimeReached, payload }.
When it evaluates to false, the wake is skipped with zero LLM cost.
Optionaltier2Decision?: {Tier 2: Fast Decision Model question evaluated via AIDecisionRunner (Default Decision /
Jev / Kev) when Tier 1 passes (or when Tier 1 is omitted).
OptionaladditionalInstructions?: stringOptional extra context instructions for the decision classifier.
Optionaloptions?: { description: string; key: string }[]Choice options when type === 'Choice'.
Question posed to the decision model along with the delta summary.
Optionaltype?: "Likelihood" | "Choice"Decision type ('Likelihood' 0-100 or 'Choice'). Defaults to 'Likelihood'.
OptionalwakeIfAtLeast?: numberMinimum likelihood score (0-100) required to wake the agent when type === 'Likelihood'.
OptionalwakeOnChoices?: string[]Option keys that trigger a wake when type === 'Choice'.
Optionaltier3WakePromptId?: stringTier 3: Optional MJ: AI Prompts ID executed via AIPromptRunner as the final gate
when deeper synthesis is required before waking the full agent.
OptionalwakeHuman-readable reason the agent scheduled this wake (injected into the wake prompt).
OptionalwatchedEntities watched for durable change detection since UserRoutine.LastCheckedAt.
Checked via GetRunViewsDatabaseStatus (COUNT(*) + MAX(__mj_UpdatedAt)) and/or
MJ: Record Changes under the routine owner's contextUser security scope.
Optionalalias?: stringOptional alias used as the key inside deltas.<alias> for Tier 1 expressions.
Exact MJ Entity Name (e.g. "MJ_BizApps_Tasks: Tasks", "MJ_BizApps_Issues: Issues").
OptionalextraFilter?: stringOptional SQL ExtraFilter (validated via SQLExpressionValidator) scoping watched rows.
OptionalincludeRecordChanges?: booleanWhen true, also inspects MJ: Record Changes for field-level diffs since LastCheckedAt.
OptionalworkstreamLogical workstream or monitor key used by self-scheduling agents (e.g. "q4-okr-rollup",
"chief-of-staff-main") to upsert a specific AgentWake routine row per workstream.
Configuration for autonomous wake conditions and durable entity change watching on
MJ: User Routines(UserRoutine.WakeConfiguration).Evaluated by
WakeGateEvaluatorinsideUserRoutineDispatcherDriverbefore invoking the routine's target (Agent, Action, or Prompt) so routines only spend LLM tokens when meaningful state changes or scheduled wake deadlines occur.