# Run workflow on a schedule
Next, let's run a workflow on a schedule to keep our HTTP triggered workflow "warm" (learn more (opens new window) about "cold starts" and the value of keeping workflows "warm"). Note: Most use cases do not require keeping a workflow "warm" — we're using the example to demonstrate how to use the Schedule trigger. This example builds on the workflow created in previous sections and will cover how to:
TIP
If you didn't complete the previous examples, we recommend you start from the beginning of this guide. If you still want to start here, copy this workflow (opens new window) and then follow the instructions below. If you have any issues completing this example, you can view, copy and run completed versions: Scheduled Workflow (opens new window), Updated HTTP Triggered Workflow (opens new window).
# Create a workflow using the schedule trigger
First, create a new workflow. Then name it Schedule Quickstart
and select the Schedule trigger (we'll modify the HTTP triggered workflow in a moment, so we recommend creating this workflow in a separate tab):
Next, expand the step menu and select the GET Request action in the HTTP / Webhook app.
Enter the endpoint URL to trigger the workflow you built in the previous examples and add /keepwarm
to the path (e.g., https://YOUR-ENDPOINT-ID.m.pipedream.net/keepwarm
).
# Test a scheduled workflow
Next, Deploy and click Run Now to test your workflow.
When you inspect the execution, you'll notice that steps.get_request
returned an array of objects. That means the HTTP workflow ran end-to-end — including getting the latest ISS position and adding it to Google Sheets:
However, we don't want that to happen on our /keepwarm
invocations. Let's fix that by adding a $end()
statement to the HTTP workflow.
Switch back to your HTTP triggered workflow, select the most recent event and expand steps.trigger.raw_event
. The uri
for the request should be /keepwarm
.
Let's use that field for our filter. When requests are made to the /keepwarm
path, let's respond with an HTTP 204
no content response and end the workflow invocation.
if(steps.trigger.raw_event.uri === '/keepwarm') {
await $respond({
status: 204,
immediate: true,
})
$end("/keepwarm invocation")
}
Deploy the HTTP workflow, return to the scheduled workflow and click Run Now again. This time, no content should be returned from steps.get_request
:
If you check the HTTP workflow, you should see the workflow execution ended at steps.filter_keepwarm
:
# Configure a schedule
Finally, return to the scheduled workflow, configure it to run every 15 minutes, and Deploy to update trigger configuration:
Your scheduled workflow will now run every 15 minutes — 24 hours a day, 7 days a week.
Next, we'll create a workflow using an app trigger to run a workflow every time there is a new item in an RSS feed.