Automations
Triggers
A trigger decides when an automation runs. Every automation has exactly one. This list is generated from appTown itself.
| Group | Trigger |
|---|---|
| Records | A record is added |
| Records | A record changes |
| Records | A record is deleted |
| Time | On a schedule |
| Outside | Another service calls a webhook URL |
| Outside | An API call (with an API key) |
| Records | Someone presses a button on a record |
| Outside | A Stripe payment event |
Stripe events a trigger can wait for:
- Checkout completed (
checkout.session.completed) - Payment succeeded (
payment_intent.succeeded) - Payment failed (
payment_intent.payment_failed) - Refund made (
charge.refunded)
#A record is added, changes or is deleted
Pick the table. For A record changes, you can watch only some fields: the automation
runs only when one of them changes. Add Only if (an expression on the
record) to narrow it further, for example [Status] = "Done".
Steps can read the record's fields, including through links: [Customer].[Email].
#On a schedule
Runs at the times of a schedule, in the timezone you pick. The schedule is written like this: minute, hour, day of the month, month, day of the week.
| Schedule | Runs |
|---|---|
0 9 * * 1-5 |
weekdays at 9:00 |
30 7 * * * |
every day at 7:30 |
0 */2 * * * |
every two hours, on the hour |
0 8 1 * * |
on the 1st of every month at 8:00 |
0 18 * * 5 |
Fridays at 18:00 |
*/15 * * * * |
every 15 minutes |
Days of the week go from 0 (Sunday) to 6 (Saturday), and 7 is Sunday too; names work as
well (MON-FRI, JAN). Lists (1,15), ranges (9-17) and steps (*/15) work in every
part. Daylight saving follows the local time:
a 9:00 schedule stays at 9:00. A scheduled run has no trigger record; use
Change records with a condition to work on records.
#Another service calls a webhook URL
The automation gets a secret URL. Any service that can call a URL (a form, a payment
provider, a script) starts it by sending a request there, without an appTown account.
Optionally answer with a fixed status and body. Steps read what was sent with
INPUT("path"). Details: Webhooks.
#An API call (with an API key)
Someone calls the automation API with their API key and JSON. The run
acts as them. Choose who may run it: everyone with access to the app, only some roles,
or only owners and editors. Steps read what was sent with INPUT("path").
#Someone presses a button on a record
Add a Button field to the table and pick the automation. Everyone who may see the record sees the button; you choose who may press it. The pressed record is the trigger record.
#A Stripe payment event
Runs when a payment event happens on the billing owner's connected Stripe account. See Payments.