Many automation systems require dynamic date-based logic — especially when generating reports, building filters, or constructing AI-driven workflows. Hardcoded month lists quickly become outdated and require manual updates.
The Challenge: Business automation often includes static month lists, manual editing every new month, risk of incorrect ordering, and non-reusable date logic.
Goal: Create a dynamic, reusable workflow module that automatically generates month data from the current month to the end of the year.
A lightweight AI Automation module built in n8n. It detects the current system month, maps Ukrainian month names, and dynamically generates structured JSON output.
// 1. Detect current month (0-11)
const now = new Date();
const currentMonth = now.getMonth();
// 2. Ukrainian Month Array
const months = [
'січень', 'лютий', 'березень', 'квітень', 'травень', 'червень',
'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'
];
// 3. Generate output from current month to December
const output = [];
for (let i = currentMonth; i < 12; i++) {
output.push({ month: months[i] });
}
// 4. Return structured JSON
return output;
Download the ready-to-use n8n workflow JSON file. Import it directly into your n8n instance.