# Run workflow on a schedule

Next, let's run a workflow on a schedule to keep our HTTP triggered workflow "warm" (learn more 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 and then follow the instructions below. If you have any issues completing this example, you can view, copy and run completed versions: Scheduled Workflow, Updated HTTP Triggered Workflow.

# 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):

image-20210525190912450

Next, expand the step menu and select the GET Request action in the HTTP / Webhook app.

image-20210525190953091

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).

image-20210525191155803

# Test a scheduled workflow

Next, Deploy and click Run Now to test your workflow.

image-20210525191406036

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:

image-20210525191520789

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.

image-20210525191622270

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")
}

image-20210525191725278

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:

image-20210525191829397

If you check the HTTP workflow, you should see the workflow execution ended at steps.filter_keepwarm:

image-20210525191854260

# Configure a schedule

Finally, return to the scheduled workflow, configure it to run every 15 minutes, and Deploy to update trigger configuration:

image-20210525191935400

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.