MySQL · New row — When a row is added to a table in your MySQL database — checks a table on a schedule. Each row past the highest value it has seen in a column that only grows — the id, or a created time — starts a run, with the row's columns by their names.

Who can do this

Workspace Admins and Editors. MySQL is a paid-plan service: you can build and test with it on any plan; publishing needs a paid plan.

Before you start

  • A MySQL connection in this workspace — see Connect a MySQL or MariaDB database. Its user needs SELECT on the table.
  • A column that only grows as rows are added: an auto-increment id is best; a created time works too.

Steps

  1. Open the workflow in the designer and open the trigger picker — Browse all triggers, or Change how it starts on an existing trigger.
  2. Select New row — MySQL. Or type MySQL in Search triggers.
  3. In Connection, choose your MySQL connection.
  4. In Table, choose the table.
  5. In Increasing column, choose the id, or the created time. A column that only grows — the id, or a created time. Each check takes the rows past the highest value seen.
  6. Under Checks, choose Every 5 minutes or Every 15 minutes.
  7. Open the Output tab and select Fetch a sample. The row with the highest value comes in, and Test run starts with it.
  8. Add the steps, test, then Publish.

What happens next

  • The first check after publishing only notes the highest value. Rows already there never start a run — only rows added after you publish.
  • Each new row starts one run, with each column by its name — {{ trigger.customer_email }}.
  • Up to 100 new rows start runs in one check, lowest value first; the rest wait for the next check, in order.
  • A check that finds nothing starts no run and costs nothing.
  • The trigger's Settings show what it is doing: when it last checked and when it checks next, and Recent checks.

Good to know

  • An id is safer than a time. Two rows written in the same second share a created time; one that arrives after the check that took the other is missed. Auto-increment ids never repeat.
  • Updated rows do not start runs. Only rows past the highest value seen.
  • Changing the table or column and publishing starts again from the highest value then.
  • Runs start in Production and count in the month's allowance.

If something goes wrong

What you see Why What to do
Table is empty. Choose one from the list. or Increasing column is empty. Choose the id, or a created time. One of them is not chosen. Choose both.
The database has no table named … Choose it again. The table was renamed or dropped. Choose the table again.
Not checking since 10:45 with MySQL refused the user or password. … The connection's sign-in stopped working. Reconnect, then Check now. See When an app trigger stops checking.
A row was missed The column is a time and two rows shared it. Use the id as the increasing column.