Scheduling n8n Automations
1. Scheduling n8n Automations
So far in this chapter, we've built workflows that react to events — a webhook fires, and the workflow runs. But there's another type of automation that's just as important: scheduled automation.2. Keeping Workflows on Schedule
These are workflows that run on a timer. Every hour, every day at 9 AM, every Monday morning. Think about the kinds of tasks that happen on a schedule in any business: daily data syncs, hourly health checks, weekly report generation, and end-of-day summaries. These aren't triggered by an event — they're triggered by time. And in n8n, we set these up with the Schedule Trigger node.3. Firing Blindly
But here's a key insight: just because a schedule fires doesn't mean the workflow should blindly do everything. Maybe we only want to run during business hours. Maybe we want to check if there are pending records before processing, or verify a dependent system is healthy first. Combining a Schedule Trigger with conditional logic gives us the reliability of a regular schedule with the intelligence of selective execution.4. Configuring the Schedule Trigger
Let's build this! We create a new workflow and add a Schedule Trigger. Inside, the first configuration is the trigger rule. We can either schedule to run on an interval — every N minutes, hours, or days — or we can choose the Cron option, which gives more precise control, like "every weekday at 9:15 AM" or "the first day of every month." We'll start with an interval set to every 30 minutes. It's important to note that schedules only run when the workflow is activated. While building in the editor, the schedule does nothing — but we can test it by executing the node or workflow. Normally, schedules kick in only after we activate and close the editor. Let's take a look at the output. Unlike a Webhook Trigger, which delivers whatever payload the sender included, a Schedule Trigger produces very little — just timestamps and datetime components for when the workflow was triggered. There's no incoming data. The trigger's job is to say "it's time to run." Our job is to build the logic that decides what happens next.5. Adding Conditional Logic
Next, we add an Edit Fields node to stamp context onto the run — we'll set a run reason of "Scheduled health check" and a timestamp using the `$now` expression. Then we add an If node. For the condition, we use the expression `$now.hour` to check whether the current hour is between 9 and 17 — that's 9 AM to 5 PM. If we're within business hours, the workflow takes the True branch. If not, it takes the False branch and skips the work. Let's click Test and see — the If node highlights which branch fired, and we can see our run reason and timestamp flowing through. This is a really common pattern. The schedule fires around the clock, but the conditional logic ensures processing only happens when it makes sense.6. Let's practice!
In the exercises, you'll practice building scheduled workflows just like this. Then, you'll combine everything you've learned from this chapter — you'll take a scheduled workflow and chain it to a downstream workflow using an HTTP Request. By the end, you'll have a workflow that runs on a schedule, constructs a payload with execution context, sends it to another workflow, and handles the response!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.