Documentation menu
Start here
IntroductionGetting startedWrite an agentProject anatomyUnderstand Ayjnt
Harness engineeringTwo runtimesHuman interfacesHow agents workHost bridgeAgent capabilities
Callable methodsState & SQLiteSessions & memorySchedulingWorkflowsDurable executionInter-agent RPCSub-agentsToolsInterfaces & integrations
Browser clientRouting & middlewareVoiceBrowser toolsMCPEmailObservabilityCLI
Command overviewnewdevrunbuildcompilemigratedeployAPI reference
AgentAgentClientWorkflow classesLocal & cloudMigrationsExamplesScheduling
Run one-time, delayed, recurring, and cron work inside the agent that owns it.
Start from a fresh project
This guide is self-contained. Create an empty Ayjnt project, then replace the starter agent with the files shown below. Run commands from the new project directory unless a step says otherwise.
bunx ayjnt new try-scheduling --empty
cd try-scheduling
bun install
# remove agents/alive once you are ready to add the guide's filesSchedule methods by name
A scheduled callback is a method on the agent. Use a number for seconds from now, a Date for a specific time, a cron expression for calendar schedules, or scheduleEvery() for fixed intervals.
async onStart() {
await this.scheduleEvery(60, "checkInbox");
await this.schedule("0 9 * * 1-5", "dailyBrief");
}
async remind(taskId: string) {
const schedule = await this.schedule(15 * 60, "sendReminder", { taskId });
return schedule.id;
}
async sendReminder(payload: { taskId: string }) {
// durable callback
}Inspect and cancel
Use getScheduleById(), listSchedules(), and cancelSchedule(). Recurring and cron calls are idempotent where documented, which makes onStart() a safe place to ensure a recurring schedule exists.
Run it and verify the result
Create a one-minute schedule, keep the dev server running, and watch the run appear in state after the agent wakes.
bun run build
bun run dev
# the local app is now available at http://localhost:8787