Choose what starts a workflow
How schedules, app events, and webhooks start a workflow, what each run is given, and what pausing a trigger does.
A trigger starts a workflow for you. A workflow can have several triggers of any kind, and each one starts its own runs. With no trigger, a workflow runs only when you start it.
The three kinds of trigger
| Kind | Starts a run | What the run is given |
|---|---|---|
| Schedule | At the times you set, or once at a date and time | Nothing extra |
| App event | When something happens in a connected app, like a new email | The event's name and its details |
| Webhook | When another app, an AI agent, or your own code calls its URL | The input text from the call |
Every run a trigger starts is a new task. Its first message is the workflow's command, like /morning-summary, followed by the event's details or the webhook's input. Write the workflow's instructions to act on what the run is given, so Polar doesn't have to go looking for the event again.
To add a trigger, open the workflow's page and click Add trigger. See Automate with workflows.
Run on a schedule
Pick Schedule, then how often:
- Every day, Every weekday, Every week, or Every hour: on repeat, at the time you pick.
- Once: one time, at a date and time in the future. The trigger removes itself after it runs.
- Custom (cron): on a cron expression with five fields, which are minute, hour, day of month, month, and day of week.
0 9 * * 1-5 is a cron expression that runs at 9:00 AM on weekdays.
Each schedule has its own time zone and runs at that time there. The workflow's page shows each schedule's next run, like Next Tue, Jul 28 at 9:00 AM PT.
Polar checks schedules once a minute, so a run can start up to a minute after its time. A workflow can have up to 20 schedules.
A schedule never runs more than once for times it missed:
- If its last run is still waiting for your computer, the next time is skipped.
- If your computer was off, or you were out of credits, when its time came, it runs once when it can and then goes back to its usual times.
- If it was paused or archived, the missed times don't run at all.
See Understand how workflows run.
Run when something happens in an app
Pick the app, then the Trigger event and the Account to watch. If the app isn't connected yet, click Connect in the Account field. Some events have settings that narrow what counts, like a search an email has to match.
- The run gets the event's name and the details the app sent with it, as text.
- To watch something different, remove the trigger and add a new one. Editing an app trigger only changes its name.
- For Slack, add the Polar app to the channel you want to watch. Slack sends events only from channels the app is in.
- If you remove the app's connector, or the account the trigger watches, the trigger is removed too.
- Events that happen while the trigger is paused, or the workflow is archived, are dropped. They don't run later.
See Connect your apps.
Run from a webhook
Pick Create a webhook. Polar gives the trigger its own URL and secret. Anything that can send a POST request with that secret starts a run, and can pass text to it. See Start a workflow from a webhook.
Pause or resume a trigger
Each trigger has its own switch on the workflow's page. A paused trigger keeps its settings but starts no runs:
| Kind | While it's paused |
|---|---|
| Schedule | Its times are skipped |
| App event | Events are dropped |
| Webhook | Calls get an error back, so the caller knows nothing ran |
Pausing also cancels that trigger's runs that were still waiting to start. A run that already started keeps going.
When you turn a schedule back on, it picks up at its next time. A Once schedule whose time passed while it was paused is removed.
To pause every trigger at once, pick Pause triggers from the workflow's ⋯ menu.
Change or remove a trigger
Click a trigger to open its details. From there, or from its ⋯ menu, you can:
- Edit it: rename any trigger, or change a schedule's time and time zone.
- Remove it, or Delete it if it's a webhook. Its runs that were still waiting to start are cancelled.
Related
Automate with workflows
Save a task as a workflow so Polar runs it on a schedule, from a webhook, or when something happens in your apps.
Start a workflow from a webhook
Call a workflow's webhook from your own code or another service: the request, the response, how to avoid duplicate runs, and how to reply on a run's task.