Member Junction
    Preparing search index...

    Driver for the User Routine Dispatcher scheduled job.

    Configuration schema (stored in ScheduledJob.Configuration): { MaxConcurrentRoutines?: number }

    Execution result details (stored in ScheduledJobRun.Details): { RoutinesEvaluated, RoutinesSeeded, RoutinesRun, Succeeded, Failed, Notified }

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get IsHighFrequencyByDesign(): boolean

      The dispatcher is a by-design 1-minute sweeper: each pass claims due routines and does bounded work, so the engine's high-frequency cron warning doesn't apply.

      Returns boolean

    Methods

    • Resolves (or lazily creates) the routine's dedicated conversation. Public so the integration suite can exercise the creation/reuse contract without an LLM call.

      The conversation is owned by the routine's owner and created with ApplicationScope='Application' + the "${ROUTINES_APPLICATION_NAME}" Application's ID, which keeps it OUT of the default chat list (the same hide mechanism meeting-room and Form Builder cockpit conversations use) while remaining fully reachable from the routine's UI. It is also Linked to the routine record (LinkedEntityID/LinkedRecordID) and pins the routine's agent as DefaultAgentID.

      Best-effort by design: any resolution/creation failure logs and returns null so the run proceeds standalone — a missing Routines app must never break a scheduled run.

      Parameters

      Returns Promise<string>

    • Run one routine now, on request, without touching its schedule.

      The sweep claims a routine before running it, which advances NextRunAt or, for a one-shot, clears it, and a cleared one-shot is Disabled after the run. A "Wake Now" implemented as "set NextRunAt to now" therefore SPENDS a one-shot: the reminder wanted tomorrow fires today and never fires again. This path skips the claim, so after the run NextRunAt still holds the scheduled time and the roll-up leaves the routine Active. It also skips the wake gate: the person asked for the run, so "nothing changed since last time" is not a reason to skip.

      contextUser is the bookkeeping identity (run row, routine roll-up), normally the scheduler's system user; the target still executes as the routine's owner, exactly as on the sweep. Ownership of the routine is the caller's check (see the Run User Routine Now action).

      Parameters

      Returns Promise<RoutineExecutionSummary>