# How to Setup Cron Jobs on Vercel

**Author:** Rich Haines

---

Cron jobs are time-based scheduling tools used to automate repetitive tasks. By using a specific syntax called a [cron expression](https://vercel.com/docs/cron-jobs#cron-expressions), you can define the frequency and timing of each task. This helps improve efficiency and ensures that important processes are performed consistently.

Vercel supports cron jobs for [Serverless](https://vercel.com/docs/concepts/functions/serverless-functions) and [Edge](https://vercel.com/docs/concepts/functions/edge-functions) Functions. This guide will show you how to create your first cron job. Alternatively, you can [start from a template](https://vercel.com/templates/next.js/vercel-cron).

## Create a cron job

The following steps will demonstrate how to create a cron job on Vercel that executes every day at 5 am UTC.

### Create a function

First, create a [Serverless](https://vercel.com/docs/concepts/functions/serverless-functions/quickstart#create-a-serverless-function) or [Edge](https://vercel.com/docs/concepts/functions/edge-functions/quickstart#create-an-edge-function) Function for your project. The function will be called every time the cron job is triggered.

### Create or update your `vercel.json` file

Go to your `vercel.json` file and add the following code:

`{ "crons": [{ "path": "/api/cron", "schedule": "0 5 * * *" } ] }` - The `path` must start with `/`    - The `schedule` property must be a string that represents a [cron expression](https://vercel.com/docs/cron-jobs#cron-expressions). In this example, the job is scheduled to execute every day at 5:00 am UTC
  

### Deploy your project

Once your project is deployed on Vercel, our build process will create the cron job. Cron jobs are invoked only for [production](https://vercel.com/docs/concepts/deployments/environments#production) deployments. [Preview](https://vercel.com/docs/concepts/deployments/preview-deployments) deployments are ignored. You can also deploy to your production domain via [Git](https://vercel.com/docs/concepts/deployments/overview#git).

Your cron job is now active and will call the `/api/cron` path every day at 5:00 am UTC. [Learn more about cron jobs](https://vercel.com/docs/cron-jobs).

## Alternative cron providers

If you prefer using a different provider for cron jobs, the following services pair well with Vercel:

- [Upstash's QStash](https://docs.upstash.com/qstash)
  
- [Pipedream](https://pipedream.com/)
  
- [Cronhub](https://cronhub.io/)
  
- [Zeplo](https://zeplo.io/)
  
- [Mergent](https://mergent.co/)
  
- [Inngest](https://vercel.com/integrations/inngest)
  
- [Defer](https://www.defer.run)

---

[View full KB sitemap](/kb/sitemap.md)
