Cron expression parser node for n8n workflows with timezone support and next run time calculation
npm install @cdmx/n8n-nodes-cron-parser

Parse cron expressions and calculate next/previous run times with timezone support for n8n workflows.
- ā° Next Run Time - Calculate when a cron job will run next
- š
Multiple Run Times - Get multiple upcoming execution times
- ā®ļø Previous Run Time - Calculate when a cron job last ran
- ā
Validation - Validate cron expressions before use
- š Timezone Support - Full IANA timezone database support
- š Multiple Output Formats - ISO strings, timestamps, or formatted dates
- š§ Flexible Input - Use expressions to pull data from previous nodes
1. Go to Settings > Community Nodes in your n8n instance
2. Select Install
3. Enter n8n-nodes-cron-parser in the search field
4. Click Install
For self-hosted n8n instances:
``bash`
npm install n8n-nodes-cron-parser
Then restart your n8n instance.
Calculate when a cron job will execute next:
Input:
- Cron Expression: 0 0 * (daily at midnight)2024-01-15T10:30:00.000Z
- Current Date/Time: UTC
- Timezone:
Output:
`json`
{
"next_run_time": "2024-01-16T00:00:00.000Z",
"cron_expression": "0 0 *",
"timezone": "UTC",
"current_date_time": "2024-01-15T10:30:00.000Z"
}
You can reference data from previous nodes using n8n expressions:
Cron Expression: {{ $json.cron_expression }} {{ $json.current_date_time }}
Current Date/Time: {{ $json.timezone }}
Timezone:
Example workflow:
`javascript
// Previous node output
{
"cron_expression": "0 0 *",
"current_date_time": "2024-01-15T10:30:00.000Z",
"timezone": "America/New_York"
}
// Cron Parser node will calculate next run time
`
Calculate multiple upcoming execution times:
Settings:
- Cron Expression: 0 (every hour)5
- Count: 2024-01-15T10:30:00.000Z
- Current Date/Time:
Output:
`json`
{
"next_run_times": [
"2024-01-15T11:00:00.000Z",
"2024-01-15T12:00:00.000Z",
"2024-01-15T13:00:00.000Z",
"2024-01-15T14:00:00.000Z",
"2024-01-15T15:00:00.000Z"
],
"count": 5,
"cron_expression": "0 ",
"timezone": "UTC"
}
Calculate when a cron job last executed:
Input:
- Cron Expression: 0 0 *2024-01-15T10:30:00.000Z
- Current Date/Time:
Output:
`json`
{
"previous_run_time": "2024-01-15T00:00:00.000Z",
"cron_expression": "0 0 *",
"timezone": "UTC"
}
Check if a cron expression is valid:
Input:
- Cron Expression: 0 0 *
Output:
`json`
{
"isValid": true,
"cronExpression": "0 0 *"
}
For invalid expression:
`json`
{
"isValid": false,
"cronExpression": "invalid cron",
"error": "Invalid cron expression"
}
This node uses standard 5-field cron format:
``
āāāāāāāāāāāāāā minute (0 - 59)
ā āāāāāāāāāāāāāā hour (0 - 23)
ā ā āāāāāāāāāāāāāā day of month (1 - 31)
ā ā ā āāāāāāāāāāāāāā month (1 - 12)
ā ā ā ā āāāāāāāāāāāāāā day of week (0 - 6) (Sunday to Saturday)
ā ā ā ā ā
*
| Expression | Description |
|------------|-------------|
| * | Every minute |0
| | Every hour |0 0 *
| | Every day at midnight |0 0 0
| | Every Sunday at midnight |0 0 1
| | First day of every month |/5 *
| | Every 5 minutes |0 9-17 1-5
| | Every hour from 9am-5pm on weekdays |0 0 1 1 *
| | January 1st at midnight (yearly) |
The node supports all IANA timezone names:
- UTC (default)
- America/New_York
- America/Los_Angeles
- Europe/London
- Europe/Paris
- Asia/Tokyo
- Australia/Sydney
- And many more...
Choose how to format the output dates:
json
{
"next_run_time": "2024-01-15T10:30:00.000Z"
}
`$3
`json
{
"next_run_time": 1705318200000
}
`$3
`json
{
"next_run_time": "Mon, 15 Jan 2024 10:30:00 GMT"
}
`Options
$3
Include additional information about the calculation (enabled by default):
- Cron expression used
- Timezone used
- Current date/time used for calculation$3
When enabled, the node will continue processing other items even if one fails, outputting error information instead of stopping the workflow.Use Cases
$3
Calculate when the next maintenance window occurs and send reminders.$3
Check if scheduled jobs are running on time by comparing actual run times with expected cron schedules.$3
Calculate multiple upcoming report generation times for scheduling purposes.$3
Calculate job execution times across different timezones for global operations.$3
Validate and test cron expressions before deploying them to production systems.Example Workflow
`
[Get Scheduled Jobs]
ā [Cron Parser - Get Next Run Time]
ā [Compare with Current Time]
ā [Send Alert if Overdue]
`Error Handling
The node provides detailed error messages:
- Invalid cron expression: Clear explanation of what's wrong
- Invalid timezone: Notification if timezone name is not recognized
- Invalid date format: Help with accepted date formats
Enable "Continue on Error" option to handle errors gracefully and continue processing.
Development
$3
`bash
npm install
npm run build
`$3
`bash
npm test
npm run test:coverage
`$3
`bash
npm run lint
npm run lint:fix
``- cron-parser - Robust cron expression parser
MIT
- GitHub Issues
- n8n Community Forum
Roney Dsilva
- Email: roney.dsilva@cdmx.in
- GitHub: @cdmx-in
- @cdmx/n8n-nodes-schema-validator - JSON Schema validation for n8n