import type { ScheduleState } from '../types.ts'; import type { EngineInternals } from './internals.ts'; import type { ScheduleCallbacks } from './schedules.ts'; export type ScheduledRunStartOptions = { occurrence?: number; /** Reserved queue identity. A fresh id is minted when omitted. */ workflowId?: string; /** Schedule state committed atomically with the workflow start. */ scheduleStateAfterStart?: ScheduleState; /** Prior terminal run whose transient schedule metadata is now settled. */ completedWorkflowId?: string; /** * Internal only (WFT-95). Set by `drainQueuedScheduleRun()` when `workflowId` * is a persisted `queuedRuns[].workflowId` being replayed, not a freshly * minted one — safe unconditionally, since a post-fix queued run was already * validated as non-`.`/`..` at schedule-admission time (relaxing the check * here is then a no-op), and it is what lets a legacy pre-WFT-95 queued run * whose id is `.`/`..` keep draining instead of pausing the schedule. * Threaded straight through to `startWorkflow`'s `skipAdmissionIdCheck`. */ skipAdmissionIdCheck?: boolean; }; /** * Launch one scheduled occurrence's workflow run and emit `schedule:fired`. * * This is the single chokepoint every occurrence launch flows through — initial * cadence ticks, `cancel-running` replacements, and `queue`-drained runs — so it * is the one place that reliably holds the launched `workflowId` across all * overlap policies. The blocked policies (`skip`, and `queue` while a run is * active) never reach here, so they correctly do not fire. * * `occurrence` is the scheduled grid timestamp the run was due, threaded from the * timer loop or retained on its durable queue entry until drain. */ export declare function startScheduledRun(internals: EngineInternals, state: ScheduleState, callbacks: Pick, options?: ScheduledRunStartOptions): Promise;