# Deploy *scheduled jobs.*

Write a script. Set a schedule. We run it automatically.

No cron syntax to memorize. No server to babysit.

## Perfect for.

- **Database backups.** Run backups every night without thinking about it.
- **Email campaigns.** Send newsletters and digest emails on schedule.
- **Cleanup tasks.** Remove old data, expire sessions, and prune logs automatically.
- **Report generation.** Generate and send reports daily, weekly, or monthly.

## How it works.

1. **Write your script.** Just a normal Node.js, Python, or Go script. No special setup.
2. **Push to Tokay.** `git push tokay`. We handle the rest.
3. **Set the schedule.** Pick when it runs from the dashboard. "Every day at 2 AM" is one click.
4. **It runs automatically.** We run your job on schedule and keep the logs. That's it.

## Scheduling, made simple.

Set your schedule from the dashboard. No cron syntax to remember.

- **Every night at 2 AM.** Perfect for nightly backups and data processing.
- **Every 15 minutes.** Keep data fresh with frequent updates.
- **First of the month.** Generate monthly reports and invoices.

## Just write your script.

Focus on your business logic. We handle the scheduling.

**Node.js scheduled job**

```javascript
async function run() {
  console.log('nightly job started');
  // Fetch data, send email, upload a backup, etc.
  console.log('nightly job complete');
}

run().catch((err) => {
  console.error(err);
  process.exit(1);
});
```

**Python digest job**

```python
import os


def run():
    recipient = os.getenv('REPORT_EMAIL', 'team@example.com')
    print(f'sending weekly digest to {recipient}')
    # Query your app, send email, write a report, etc.


if __name__ == '__main__':
    run()
```

**Go cleanup task**

```go
package main

import (
    "log"
    "time"
)

func main() {
    cutoff := time.Now().AddDate(0, 0, -30)
    log.Printf("cleaning up records before %s", cutoff.Format("2006-01-02"))
    // Delete old sessions, prune logs, expire trials, etc.
}
```

That's it. Push your script, set the schedule, and forget about it.

## What we handle for you.

- **Reliable scheduling.** Your jobs run on the schedule you set. Predictable timing, no drift.
- **Errors and logs.** Every run is logged. When a job fails, you see exactly what went wrong.
- **Timezone aware.** Set your timezone once. Jobs run when you expect, wherever you are.

- [Read the scheduled jobs doc for schedules, run history, and alerts](/docs/scheduled-jobs)
- [Not sure it's a scheduled job? Check which service type fits](/docs/which-service-type)
