Workflow automation is all about saving time and reducing errors. But what about the very first step—triggering the workflow itself? For decades, developers have relied on the powerful but notoriously cryptic cron syntax. A single misplaced asterisk in 0 17 * * 5 can mean the difference between sending a report on time and missing a critical deadline.
There has to be a better way.
Introducing schedule.when, the intelligent scheduling trigger for your action.do workflows. We believe that defining when a task should run should be as simple as describing it in plain English. With schedule.when, you get the best of both worlds: the precision of classic cron and the revolutionary simplicity of natural language.
Cron is a cornerstone of automation for a reason: it's a precise, standardized tool for time-based job scheduling. If you're a seasoned system administrator, you might even think in cron syntax.
We respect that. That's why schedule.when fully supports traditional cron expressions. You can bring your existing knowledge and complex schedules directly into the action.do ecosystem.
import { Dō } from '@do-sdk/core';
const dō = new Dō({ apiKey: 'YOUR_API_KEY' });
// Schedule a workflow using a familiar cron string
dō.workflow.create({
name: 'weekly-system-backup',
// Trigger every Sunday at 3:00 AM
trigger: dō.schedule.when('0 3 * * 0'),
actions: [
// ... sequence of atomic actions for the backup
]
});
But for many, cron is a barrier. It's not readable, it's hard to learn, and it makes "Business-as-Code" difficult when the business logic is hidden behind a string of symbols.
This is where schedule.when changes the game. Why not define your schedule just as you would describe it to a colleague?
Our powerful natural language processing engine translates simple, human-readable strings into precise execution schedules.
Let's look at some examples.
Run a task every 30 minutes:
dō.workflow.create({
name: 'check-new-support-tickets',
trigger: dō.schedule.when('every 30 minutes'),
// ...
});
Send a report every Friday afternoon:
dō.workflow.create({
name: 'send-weekly-sales-report',
trigger: dō.schedule.when('every Friday at 4pm'),
// ...
});
Generate invoices on the last day of the month:
dō.workflow.create({
name: 'generate-monthly-invoices',
trigger: dō.schedule.when('at 11pm on the last day of every month'),
// ...
});
The benefits are immediate:
schedule.when is the starting pistol for your automations. It's the trigger that initiates a workflow.do instance. That workflow, in turn, is a carefully orchestrated sequence of the atomic, single-responsibility tasks you define with action.do.
This separation of concerns is fundamental to building robust Business-as-Code. The timing logic is clear, the workflow orchestration is explicit, and the business actions are atomic and reliable.
Q: How accurate is the natural language parsing?
A: schedule.when is powered by a sophisticated NLP engine trained on a vast number of time-based expressions. For common and complex scheduling patterns, it's highly accurate. To ensure complete confidence, the API allows you to preview the parsed cron equivalent before deploying your schedule.
Q: What about timezones?
A: We know global teams need timezone-aware scheduling. By default, schedules run in UTC, but you can easily specify a timezone in your definition, such as "every day at 9am America/New_York". This ensures your workflows trigger at the correct local time for your users or operations.
Q: Can I see the parsed cron string from my natural language input?
A: Absolutely. Transparency is key. The schedule.when API returns the parsed cron expression alongside a confirmation, giving you the confidence that your intent has been correctly interpreted by the system.
Q: How does schedule.when fit with workflow.do and action.do?
A: schedule.when is the trigger for a workflow.do process. It answers the "when". workflow.do orchestrates the "how" by sequencing a series of action.do tasks. The actions themselves are the "what"—the granular, atomic units of work that get things done.
Stop wrestling with cryptic syntax and debugging misplaced asterisks. It's time to bring clarity and simplicity to your automation triggers. By combining the power of cron with the accessibility of natural language, schedule.when empowers your entire team to build, execute, and automate flawless workflows.
Ready to start scheduling the smart way? Explore the action.do documentation and build your first natural language-triggered workflow today.