# Trigger shape (schedule)

## Introduction

Trigger `schedule` options are used to schedule the associated process flow to run at a specified frequency and/or time. Here, you can use intuitive selection options to define your requirements or - if you are familiar with regular expressions - use advanced options to build your own expression.

{% hint style="info" %}
Trigger schedules are based on [Coordinated Universal Time (UTC)](https://time.is/UTC).
{% endhint %}

## Scheduling options (occurrence)

Schedules can be defined based on the following occurrences:

* [Minutes](#minutes)
* [Hourly](#hourly)
* [Daily](#daily)
* [Monthly](#monthly)
* [Advanced](#advanced)

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/TLSNxVaFwkbGcOU5w3O7)

</details>

### Minutes

Define a schedule to run every `x` minutes - for example:

<div align="left"><figure><img src="/files/LLtWCUBtcuMtnaIUVw8j" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Behind the scenes, the `minutes` schedule uses a  `*/n * * * *` Cron expression. This means: *run when the value is a multiple of n*.&#x20;

For example, choosing to run a flow every 45 minutes would be expressed as `*/45 * * * *` , so the flow will trigger on the hour (0) and 45 minutes past the hour.&#x20;

If you only want to trigger the flow at 45 minutes past the hour, you should use the [advanced](#advanced) option and define a Cron expression in the form: `n * * * *` , where `n` is the required number of minutes. \
For example: `45 * * * *`\
\
The following website may be useful if you need help with Cron expressions: <https://crontab.guru/>
{% endhint %}

### Hourly

Define a schedule to run every `x` hours - for example:

<div align="left"><figure><img src="/files/BHy3Q9wvXKrKwSy63FCv" alt="" width="375"><figcaption></figcaption></figure></div>

### Daily

Define a schedule to run on selected days of the week at a given start time - for example:

<div align="left"><figure><img src="/files/mJGNHwB8cRJkaTvd53qY" alt="" width="375"><figcaption></figcaption></figure></div>

Use the **every** dropdown list for quick daily presets, or define custom settings:

<div align="left"><figure><img src="/files/srRGhb0iK2UfGSlyCoat" alt="" width="375"><figcaption></figcaption></figure></div>

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/7cBP9KoiIVRZrcvW0ZeM)

</details>

### Monthly

Define a schedule to run on selected days of the month or weeks, for selected months, at a given start time - for example:

<div align="left"><figure><img src="/files/uAkMLcXzYDTeQrLE013l" alt="" width="375"><figcaption></figcaption></figure></div>

Use the **every** dropdown list for quick monthly presets, or define custom settings:

<div align="left"><figure><img src="/files/ljhywqbdIPaVP2OeL3U6" alt="" width="375"><figcaption></figcaption></figure></div>

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/sJSNlgXZfpK9P5A30Kgf)

</details>

### Advanced

If you are familiar with cron expressions, you can select this option to activate the **cron expression** field beneath and enter your required expression directly:

<div align="left"><figure><img src="/files/aYQ8pMRMjLRC3VaT0Nwf" alt="" width="375"><figcaption></figcaption></figure></div>

Patchworks supports the 'standard' cron expression format, consisting of five fields: minute, hour, day of the month, month, and day of the week.&#x20;

{% code lineNumbers="true" %}

```json
minute (0-59) hour (0-23) day_of_month (1-31) month (1-12) day_of_week (0-6)
```

{% endcode %}

Each field is represented by a number or an asterisk (\*) to indicate any value. For example:\
`0 5 * * *` would run at 5 am, every day of the week.

{% hint style="warning" %}
Extended cron expressions (where six characters can be used to include seconds or seven characters to include seconds and year) are not supported.
{% endhint %}

## Adding a trigger schedule

Follow the steps below to add a new trigger schedule.

**Step 1**\
To add a new schedule, click the **add new schedule** button:

<div align="left"><figure><img src="/files/uaps1AcA2LIV9csF9k2C" alt="" width="336"><figcaption></figcaption></figure></div>

**Step 2**\
Select an [occurrence](#scheduling-options-occurrence).

**Step 3**\
Define your required settings for the occurrence.

**Step 4**\
Click **save** to save this schedule. The schedule is added to the shape - for example:

<div align="left"><figure><img src="/files/fDnacWgv0sPf2waUZJvG" alt="" width="375"><figcaption></figcaption></figure></div>

### Multiple schedules

You can add a single schedule or multiple schedules. When you add multiple schedules, ALL of them will be active.


---

# Agent Instructions: 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:

```
GET https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape/trigger-shape-schedule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
