Skip to main content
Version: v2.x

Creating a one-off scheduled event

Introduction

One-off scheduled events are used to reliably trigger an HTTP webhook to run custom business logic at a particular point in time. For example, you can create a scheduled event to send a reminder email two weeks after a user signs up.

To add a one-off scheduled event, follow these steps:

Step 1: Navigate to One-off Scheduled Events

  • Go to the Events tab in your Hasura console.
  • Click One-off Scheduled Events.
  • Click Schedule an event.
Adding a one-off scheduled event

Step 2: Define the scheduled event

Define the following values for a scheduled event:

  • Webhook: Enter the HTTP endpoint that should be triggered.
  • Time: Enter the time to trigger the event.
  • Payload: The JSON payload which will be sent to the webhook.
In the form opened by the above step, fill out the following fields:
Defining the scheduled event

Step 3: Define advanced options (Optional)

If you like, you can also define advanced values:

  • Headers: List of headers to be sent to the webhook.
  • Retry configuration: In case the call to the webhook fails.
  • Comment: Custom description of the scheduled trigger.

Expand the Advanced section.

Defining advanced options for a scheduled event

Schedule & logs

Once you've created your scheduled trigger, you can see Pending events, Processed events, and Invocation logs in their respective tabs.

Schedule and logs for scheduled events
Note

A scheduled event will be delivered within ten seconds of when it's scheduled. For example, if you schedule an event at 09:24:10, it will be delivered between 09:24:10 and 09:24:20.

This is because Hasura currently checks for events to be delivered at 10 second intervals. This interval will be made configurable soon.