> For the complete documentation index, see [llms.txt](https://docs.infotopics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infotopics.com/mailscheduler/features/schedules/trigger-based-schedules.md).

# Trigger-based schedules

### What is a trigger-based schedule?

Schedules can be executed based off of triggers. These triggers can either be sent from Tableau, when a workbook or datasource extract has finished, or executed with a custom implementation.

### Adding a new trigger-based schedule

<figure><img src="/files/T2uK9ilOmNBptrxzPMB1" alt=""><figcaption></figcaption></figure>

When creating a schedule, you can now opt to create a "Trigger-based" schedule. Select this option, and then press the 'Create Schedule' button.

After the schedule is created, you will need to first add tasks before you can define the triggers. Go to the Tasks page, and add a view as normal.

With at least one defined view, go to the Triggers tab of the schedule:

<figure><img src="/files/Nr3DPhN5oupL3m0pqtfp" alt=""><figcaption></figcaption></figure>

Here, you can decide what will trigger your schedule. This can be a custom integration, [#using-custom-triggers](#using-custom-triggers "mention"), or Tableau triggers.  For tableau triggers, you usually only select either a workbook to trigger the schedule, or a datasource. If you have a bunch of datasources that refresh one after the other, only pick the last one to finish. This way, you know you will get an up-to-date view.&#x20;

When you have selected how you want the schedule to be triggered, you can press the 'Save Triggers' button. Afterwards, you can press the 'Test Tableau Webhook connections' button to test if the connection from Tableau to your server is successful.

### Using custom triggers

To use custom triggers, your need to send POST requests to *yourmailschedulerinstance*/api/webhooks.&#x20;

The format of the body needs to be as follows:

```
{
  "site_luid": "1ab1b12c-1234-1a12-1a2b-a1234bc5d678", // Your site LUID
  "event_type": "custom",
  "schedule_ids": [3,4] // These schedules need to exist!
}
```

If the schedules are **enabled**, this will trigger their execution.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infotopics.com/mailscheduler/features/schedules/trigger-based-schedules.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
