@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
25 lines • 1.15 kB
TypeScript
import { WorkflowScheduler } from '../../workflows/scheduler/scheduler.js';
import type { WorkflowSchedulerConfig } from '../../workflows/scheduler/types.js';
import { MastraWorker } from '../worker.js';
import type { WorkerDeps } from '../worker.js';
/**
* Drives cron-based workflow schedules. On each tick it polls storage
* for due schedules, computes next fire times, and publishes
* workflow.start events. Does not consume events — only produces them.
*
* This is the **single** scheduler code path. The Mastra constructor
* adds the worker to the default workers list (guarded by
* `#shouldEnableScheduler()`), and `startWorkers()` initializes it.
*/
export declare class SchedulerWorker extends MastraWorker {
#private;
readonly name = "scheduler";
constructor(config?: WorkflowSchedulerConfig);
init(deps: WorkerDeps): Promise<void>;
start(): Promise<void>;
stop(): Promise<void>;
get isRunning(): boolean;
/** Expose the underlying scheduler for direct API access (e.g., schedule management). */
get scheduler(): WorkflowScheduler | undefined;
}
//# sourceMappingURL=scheduler-worker.d.ts.map