# Cron Expression Validator & Next-Run Calculator (`comall-agency/cron-expression-tool`) Actor

Validate standard 5-field cron expressions, get a plain-English description of each schedule, and compute the next run times in UTC (1 to 20 per expression). Supports \*, lists, ranges and steps. An invalid expression is reported in its own row, not as a batch error.

- **URL**: https://apify.com/comall-agency/cron-expression-tool.md
- **Developed by:** [Comall Agency](https://apify.com/comall-agency) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 cron expression checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Cron Expression Validator & Next-Run Calculator

Find out what a cron expression actually does before you commit it to a
scheduler. This Actor validates standard 5-field cron expressions, describes
each one in plain English, and computes the next run times in UTC.

Pure algorithm, no third-party API, no signup.

### What it does

For each expression you send, it:

1. Parses the five fields — minute, hour, day-of-month, month, day-of-week —
   supporting `*`, lists (`1,2,3`), ranges (`1-5`) and steps (`*/15`).
2. Reports whether the expression is syntactically valid.
3. Produces a **plain-English description** of the schedule.
4. Computes the **next N run times in UTC** (you choose N, from 1 to 20;
   the default is 5).

An invalid expression is reported as invalid in its own output row — it does
not stop the rest of the batch.

### Use cases

- **Code review** — paste the cron lines from a pull request and read back
  what they actually mean, instead of decoding `*/7 3 * * 2` by hand.
- **Migrations and audits** — dump every schedule from a crontab, a CI
  config or an ERP job table and confirm each one still means what its
  comment claims.
- **Documentation** — generate readable descriptions of your scheduled jobs
  for a runbook.
- **Debugging a job that "never runs"** — see the next computed run times,
  or discover the expression matches nothing at all.

### Input

```json
{
  "expressions": ["*/15 * * * *", "0 9 * * 1-5", "not a cron"],
  "runsToCompute": 5
}
```

`expressions` is required. `runsToCompute` is optional (default 5, minimum
1, maximum 20).

### Output (one row per expression)

```json
{
  "input": "0 9 * * 1-5",
  "valid": true,
  "description": "at minute 0 past hour 9, on day-of-week 1-5 (0=Sun)",
  "next_runs_utc": ["2026-08-31T09:00:00.000Z", "2026-09-01T09:00:00.000Z"]
}
```

### Pricing

Pay-per-event: **$0.003 per expression checked**, charged once a completed
answer is produced — valid or invalid.

### Limitations — read this before you buy

- **Standard 5-field cron only.** No seconds field (the 6-field Quartz-style
  syntax is not parsed) and no `@daily` / `@hourly` / `@reboot` macros.
- **UTC only.** There is no timezone parameter. If your scheduler runs in a
  local timezone with daylight saving, the computed times will not match it.
- The next-run search is **bounded to two years ahead**. An expression that
  matches nothing in that window — `30 2 30 2 *`, February 30th — is
  reported as syntactically valid with zero runs found, not as an error.
  That distinction is deliberate: the syntax really is valid, and silently
  calling it invalid would hide the actual problem.

### FAQ

**Why does my expression validate here but fail in my scheduler?**
Most likely a dialect difference: seconds fields and `@macros` are
extensions that many schedulers accept and this Actor does not parse.

### Related Actors

Part of the same family of small, single-purpose checkers on this account —
each does one thing, priced per item checked:

- [IBAN Validator & Formatter](https://apify.com/comall-agency/iban-validator-formatter) — ISO 13616 length + mod-97 checksum, fully offline.
- [Card Number Validator (Luhn)](https://apify.com/comall-agency/card-number-validator) — Luhn checksum and card-network detection, output is masked.
- [Barcode Check-Digit Validator](https://apify.com/comall-agency/barcode-checkdigit-validator) — EAN-13, EAN-8 and UPC-A check digits.
- [EU VAT Number Checker](https://apify.com/comall-agency/eu-vat-checker) — official VIES lookup.
- [Email Address Validator](https://apify.com/comall-agency/email-address-validator) — syntax, domain and MX checks.
- [Password Strength Checker](https://apify.com/comall-agency/password-strength-checker) — entropy scoring, never returns the password.

# Actor input Schema

## `expressions` (type: `array`):

Standard 5-field cron expressions (minute hour day-of-month month day-of-week). Supports *, lists (1,2,3), ranges (1-5), and steps (*/15).

## `runsToCompute` (type: `integer`):

How many upcoming run times to compute per valid expression.

## Actor input object example

```json
{
  "expressions": [
    "*/15 * * * *",
    "0 9 * * 1-5",
    "not a cron"
  ],
  "runsToCompute": 5
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "expressions": [
        "*/15 * * * *",
        "0 9 * * 1-5",
        "not a cron"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("comall-agency/cron-expression-tool").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "expressions": [
        "*/15 * * * *",
        "0 9 * * 1-5",
        "not a cron",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("comall-agency/cron-expression-tool").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "expressions": [
    "*/15 * * * *",
    "0 9 * * 1-5",
    "not a cron"
  ]
}' |
apify call comall-agency/cron-expression-tool --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,comall-agency/cron-expression-tool"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/X5MFeub5lYDnytWtb/builds/0jUHYA5pjPvOyvM4H/openapi.json
