Skip to main content
Cartegraph Campus

Webhook Example: Reschedule Tasks Based on the Weather Forecast

You must have administrator rights to access this feature.

This feature may not be available in every package. Not sure if you have this feature or you want to learn more about it? Send us a message at support@cartegraph.com

This example will walk you through rescheduling street sweeping tasks in Cartegraph depending on today's weather.

  1. Go to https://zapier.com/  and set up a free account or access your existing account. 
  2. Click Make a Zap.
  3. In the  When this happens dialog box, start to type the word weather  and select Weather by Zapier. 
  4. In the Choose Trigger Event dialog box, select Today's Forecast and click Continue.
    webhook example forecast.png
  5. Enter the latitude and longitude for your location and click Continue.

If the longitude is XX.XXX West, you would add a negative sign.
webhook example longitude.png

  1. Click Test & Continue.
    webhook example testcontinue.png
  2. In the field near the top of the Do this dialog box, start typing webhook and select Webhooks by Zapier.
    webhook example do this.png
  3. In the Choose an Event list, select Custom Request and click Continue.
    webhook example custom request.png

At this point, we will switch to a different browser tab and start to create an automation in Cartegraph. This new automation will have an incoming webhook as its trigger.

  1. In another browser, click iAdministration_sm.png>Automation Manager.
  2. Click the Create Automation button.
  3. Start typing incoming and select the Incoming Webhook trigger.
    webhook example incoming recipe.png
  1. The trigger will begin our new automation. Our automation will be triggered when an external application calls the URL shown in the URL property on the right side of the screen. Whenever you create a new incoming webhook automation, a unique URL is automatically generated. 
  2. Click iCopyURL.png to the right of the URL to copy the path to the clipboard.
    webhook example automation copy URL.png
  3. Switch back to the browser tab with Zapier. Set the http method to Post and paste the URL from your clipboard into the URL text box.
  4. In the Data field, carefully enter the following text and make it look like this:


    "PrecipChance": , 
    "HighTemp": , 
    "LowTemp":  

  1. Click webhook example iZapier.png and select each of these weather values next to the appropriate property:
  • Precip Probability
  • Temperature Max
  • Temperature Min

When you have the detail section set up correctly, it should look like the following. Notice how the first two properties are followed by commas, but the third is not.
webhook example notice commas.png

  1. Scroll to the bottom of the page and click Continue.
  2. The following page displays. Do not click the blue button yet.
    webhook example do not press blue button.png

We will need to coordinate sending a test message to Cartegraph. To do this, we will need to click a button in two different browser pages in fairly quick succession. Before continuing, would be easiest if you first arrange the browsers on your monitor or monitors so you can see both the Zapier window and the Cartegraph automation window at the same time.

  1. Click Capture on the Cartegraph incoming webhook page.
    webhook example orange button.png
  2. Quickly click the Test & Continue button in the Zapier window.
    webhook example blue button.png
    If the test was successful, the Zapier screen should look like this:
    webhook example test success.png
    and the Cartegraph screen should look like this:
    webhook example OMS test result.png
  3. In Zapier, click Done Editing.
  4. Enter a name for your zap in the top left and click Turn Zap On.
    webhook example turn zap on.png
  5. Click Go To My Zaps. You should see this:
    webhook example zap home.png
  6. Switch to the Cartegraph tab.
    webhook example back to OMS.png
    The test message sent from Zapier is visible in the Example Body field. The three fields defined there can be used by other blocks in the rest of the automation.

Now we will finish creating the automation to reschedule street sweeping tasks if there is a greater than 60% chance of rain.

  1. Click and drag a Condition block to the Actions section and configure the conditions as shown here:
    webhook example conditions.png
    The three properties sent in the test message from Zapier are available.
  2. Select the PrecipChance property and configure the rest of the automation as shown here:
    webhook example precipchance.png
  3. Click and drag a Loop Records block to the Actions section and configure it as shown here:
    webhook example loop records.png
    So far, our automation will check if the chance of rain is greater than 60 percent; then it will loop through the street sweeping tasks scheduled for today.
  4. Click and drag a Set Fields block to be nested under the Loop through todays street sweep tasks in the Actions section and configure it as shown in the following image.
    webhook example set fields rain delay.png
    This will reschedule each street sweeping task scheduled for today to tomorrow.
  5. We must save each task. Click and drag the Save Record block and configure it as shown in the following image.
    webhook example save blocks rain delay.png
  6. To finish the automation, rename it in the upper left part of the screen, turn it on, and click Save.
    webhook example save rain delay automation.png

Every morning at about 7:00 a.m., Zapier will check today's weather forecast and send up-to-date information to Cartegraph using the URL for an incoming webhook. The automation will look at the details of the day's weather and make a decision based on the chance of rain. If the chance of rain is greater than 60%, the automation will loop through the street sweeping tasks scheduled for today and reschedule them for tomorrow.

  • Was this article helpful?