Perfect for content publishing with organic scheduling patterns, social media automation, API systems that need to avoid rate limiting, or any automation requiring randomised timing control across multiple periods.
All times are configured in local timezone with automatic UTC conversion for technical operations.
Features easy slot management with chronological ordering, gap support, and 24-hour window scheduling.
schedulerExecutionTime
in Init node (match it to Schedule Trigger cron)Two variables to set in the Init node's "Custom Configuration" section:
1. When the scheduler runs daily:
const schedulerExecutionTime = 1; // 1am (24h clock; must match Schedule Trigger node)
2. Your execution slots:
const subprocessTimeSlots = {
morning: { start: 6, end: 12, probability: 0.85 },
afternoon: { start: 12, end: 18, probability: 0.85 },
evening: { start: 18, end: 24, probability: 0.5 }
};
That's it. Three slots, three probabilities.
Add or remove slots, adjust times - it just works.
Real-world example with gaps:
const subprocessTimeSlots = {
night: { start: 0, end: 2, probability: 0.1 }, // Optional late activity
morning: { start: 6, end: 10, probability: 0.85 }, // Gap from 2-6am (no execution)
noon: { start: 12, end: 14, probability: 0.85 }, // Gap from 10am-12pm
afternoon: { start: 16, end: 18, probability: 0.85 }, // Gap from 2-4pm
evening: { start: 20, end: 24, probability: 0.5 } // Gap from 6-8pm
};
3. Configure Execute sub-process with your workflow ID
Your sub-workflow MUST start with a Wait node and be configured with {{ $json.executions.relativeDelaySeconds }}
as “Wait Amount”.
4. Additional Configuration
const LOCAL_TIMEZONE = $env.GENERIC_TIMEZONE || 'Europe/Paris';
by default// ⚠️ Your email here
• const N8N_ADMIN_EMAIL = $env.N8N_ADMIN_EMAIL || '[email protected]';
// ⚠️ Your projects’ ROOT folder on your mapped server here
• const N8N_PROJECTS_DIR = $env.N8N_PROJECTS_DIR || '/files/n8n-projects-data';
// ⚠️ Your project’s folder name here for logging
• const PROJECT_FOLDER_NAME = "RPS";
/local-files:/files
)IMPORTANT: Your sub-workflow MUST start with a Wait node and be configured with {{ $json.executions.relativeDelaySeconds }}
as “Wait Amount”.
Use Cases: