Automation and Scheduled Tasks
Two kinds of automation
Section titled “Two kinds of automation”| Type | Trigger | Example |
|---|---|---|
| One-time | Runs once at a set time | “Remind me at 3 PM tomorrow” |
| Recurring | Repeats on a rule | “Every morning at 8, produce a report” |
Writing schedule rules
Section titled “Writing schedule rules”Schedules use a standard recurrence expression. Common patterns:
| Goal | Key fields |
|---|---|
| Daily at 9 AM | frequency = daily, hour = 9, minute = 0 |
| Mon/Wed/Fri at 9 | frequency = weekly, days = MO,WE,FR, hour = 9 |
| Every 2 hours | frequency = hourly, interval = 2 |
| 1st and 15th monthly | frequency = monthly, day = 1,15, hour = 9 |
Key technique: put multiple days in one task with a comma-separated list, not one task per day.
❌ three separate tasks for Mon, Wed, Fri✅ one task with days = MO,WE,FRKeep the task list deduplicated by logical task; duplicates make management painful.
The most important rule: prompts must be self-contained
Section titled “The most important rule: prompts must be self-contained”A scheduled run cannot see your current conversation.
It only has what you wrote into the task. Company names, file paths, metric definitions, URLs, preferences — everything goes in the prompt.
❌ "Generate yesterday's data report"
✅ "Read /Users/me/data/sales.csv, keep only yesterday's rows, aggregate by region, write a Markdown report to /Users/me/reports/YYYY-MM-DD.md containing total revenue, top 5 regions, and day-over-day change. Start with a one-sentence conclusion."Test: could you execute this prompt six months from now? If not, keep adding detail.
Automate whole outcomes, not just the first step
Section titled “Automate whole outcomes, not just the first step”❌ "Scrape today's AI news"✅ "Scrape today's AI news → distill into 10 Chinese bullet points → generate a cover image → schedule them to X via Buffer"A task that completes the whole chain is what actually saves your time. Automating step one still leaves you four manual steps every day.
Managing existing tasks
Section titled “Managing existing tasks”You can list all tasks with status, view details, update fields, or delete.
When updating, send only the fields you’re changing — everything else is preserved.
⚠️ Don’t edit automation config with shell commands or file operations. Use the dedicated tooling; manual edits cause inconsistent state.
A real-world example
Section titled “A real-world example”Requirement: monitor several accounts for new posts, translate, publish.
Configuration essentials:
- Frequency: every 2 hours
- Prompt states: which accounts, what script, log file path, whether to backfill history
Lessons learned here:
- Always write logs to a file — otherwise failures are undebuggable
- Scripts must run non-interactively or they hang forever
- Gate historical backfill behind a flag, or launch day republishes months of old content