MySQLMySQL

Your MySQL or MariaDB database, from a flow. The action reads, adds, changes and deletes rows with forms — no SQL to write — and runs your own SQL when a form can't do it. It can also be an AI toolkit that lets an AI Node touch only the tables you list. As a trigger it starts a flow for each new or changed row of a table.

Setup

1. Create the credential

Under Settings → Credentials, or straight from the node, pick MySQL, name it, and fill in:

  • Host and Port (3306 if you leave it empty). Your server's address, e.g. mydb.abc123.us-east-1.rds.amazonaws.com. Through a tunnel it is localhost.
  • User and Password. The password is encrypted. It comes back to the panel only in Edit keys and settings, after you verify it's you, and only for a person who can see it: change it there.
  • Database (optional): the one to use by default. The node and the trigger can pick another.
  • TLS and the CA certificate: see below.
  • Tunnel (optional): for a database HostWebhook can't reach over the internet.

Or paste a URL. A URL like mysql://user:password@host:3306/database (the one PlanetScale gives you) fills the fields. HostWebhook reads it itself: only the host, port, user, password and database count, plus the TLS mode (ssl-mode). Any other setting in the URL is refused by name — for example socketPath or multipleStatements — because HostWebhook connects over the network only and never lets a URL choose how the driver behaves.

TLS and the CA certificate

ModeWhat it does
RequiredEncrypted, and the certificate and the server's name are checked. The default. e.g. RDS, PlanetScale.
OffNot encrypted. It only works through a tunnel (the tunnel already encrypts the connection): without one it is refused.

HostWebhook always checks the certificate: there is no mode that encrypts without checking it, because anyone in the middle could pass as your server and read the connection. When the server's certificate carries the server's name, use Required with that certificate pasted as the CA. When it doesn't, connect through a tunnel.

A credential saved before with Required, no check, or with Off and no tunnel, isn't deleted. Its card says Required, no check (not accepted any more) or Off (only works through a tunnel), and a Test or a run says what to do: “This connection skips the check of the server's certificate, which HostWebhook does not allow. Paste the CA certificate of your server in the credential, or connect through a HostWebhook tunnel.” Change it in Edit keys and settings on the credential: Required (and the CA) or a tunnel.

The CA certificate only counts with Required. Paste the PEM your provider gives you, as text — never a file path: HostWebhook doesn't read files from its own disk, and a path is refused with a message that says so. Empty means the usual public roots. For Amazon RDS and Aurora pick the shortcut instead of pasting the bundle. You can paste a certificate or pick the shortcut, not both.

Where it livesWhat to choose
PlanetScaleTLS Required. Its certificate comes from the public roots, so the CA box stays empty. Paste its URL (mysql://…) and HostWebhook reads it.
Amazon RDS and AuroraTLS Required, and in the CA box pick the Amazon RDS / Aurora shortcut: AWS's own certificate bundle is not among the public roots. In the security group, allow HostWebhook's egress IP.
Aiven, DigitalOcean, Google Cloud SQLTLS Required, and paste the CA certificate (the PEM) that the provider's console gives you, e.g. Aiven's ca.pem.
A server with its own certificateIf the certificate carries the server's name: TLS Required, with that certificate pasted in the CA box. If it doesn't (the ones MySQL generates by itself usually don't): use a tunnel, with TLS Off, because the tunnel already encrypts the connection.
A hosting with cPanelRemote MySQL is usually closed: open it for HostWebhook's egress IP, or use a tunnel.
A database on your own networkUse a tunnel, with TLS Off: see Tunnels.

Where HostWebhook connects from

HostWebhook only connects to public hosts. A name that resolves to a private address, a loopback address (localhost, 127.0.0.1) or a metadata address is refused when you save the credential and every time it connects, with “HostWebhook only connects to public hosts. For something on a private network, use a tunnel.” If your provider filters by IP (Amazon RDS security groups, Aiven, cPanel), allow HostWebhook's static egress IP, which you find in the banner when you create a database credential.

For a database on a homelab, a VPC or a Mac on your desk, run hostwh expose-tcp --target=localhost:3306 --id=prod-mysql (or the Docker agent ghcr.io/hostwebhook/agent), check in Settings → Tunnels that it shows online, and pick it in the Tunnel field of the credential. With a tunnel the destination is your own network, so HostWebhook doesn't check the address; the host is then the one you type, e.g. localhost. Through a tunnel, use TLS Off: the tunnel already encrypts the connection. TLS Required through a tunnel doesn't work yet: the certificate would be checked against the tunnel's local address, not your host. Putting, changing or removing a tunnel asks for the password again, in the same request: the tunnel decides where the password travels. On the credential page that is Edit keys and settings: after you verify it's you, the same form opens, filled with what the credential has. A password you can't see comes empty, and leaving it empty keeps it (a change of tunnel needs it, as above).

2. Test the connection

Test connection on the credential page shows one line with the server's version, the TLS version and the user, e.g. MySQL 8.0.39 · TLS 1.3 · hostwebhook@%. If the user has ALL PRIVILEGES, SUPER or FILE, it warns you and links to the user to create.

What HostWebhook keeps

ℹThe user and the password, encrypted, and — in plain sight, to tell credentials apart — the host, the port, the TLS mode, whether a CA certificate was pasted and the shortcut you picked. Never the password or the certificate text in a response, a log or a run. The user shows up in one place only: the line of Test connection, to tell which account answered, and it isn't saved. Marking the credential sensitive hides all of that too, except in Test connection, which shows the user, the host and the database to anyone who can use the credential. Changing the host, the port, the user, the TLS mode or the certificate means sending the whole connection again, password included: there is no “keep the saved password” when you point it at another server.

The MySQL user

Give HostWebhook a user of its own, with only what the flow needs:

sqlA user for HostWebhook
CREATE USER 'hostwebhook'@'%' IDENTIFIED BY '…' REQUIRE SSL;
GRANT SELECT, INSERT, UPDATE ON shop.orders TO 'hostwebhook'@'%';  -- DELETE only if a flow deletes
  • A trigger only needs SELECT on the table it watches.
  • An AI toolkit needs the privileges for the tables on its list, and no more.
  • Never FILE (it reads and writes files on the server), SUPER, PROCESS or GRANT OPTION.
  • If you turn on query_mysql or execute_mysql_sql for an AI, the user's privileges are the limit of what it can read or change.

Operations

Drop a MySQL node, pick the credential, choose Single operation (or AI toolkit) and an operation. Database is empty for the credential's own database; Table is picked from the list the server gives (views are marked), and you only see what the user can see.

ValueIn the dropdownWhat it doesComes back as
getRowsGet rowsThe rows of a table that match the filters, in the order you pick. 100 by default, up to 1,000.rows · rowCount
insertRowsInsert rowsAdds one or more rows (up to 500 at a time). You get back the rows as they ended up.affectedRows · insertId · rows
updateRowsUpdate rowsChanges the columns you pick in every row that matches ALL the filters. At least one filter is required.affectedRows · changedRows · rows
upsertRowsUpsert rowsAdds rows, or updates the ones that already exist with the same primary or unique key.inserted · updated · rows
deleteRowsDelete rowsDeletes every row that matches ALL the filters. At least one filter is required. You get back the rows as they were.affectedRows · rows
runSqlRun SQLOne SQL statement of your own, for what the other operations can not do: joins, schema changes, procedures.rows or affectedRows

Filling in the fields

  • Filters are a list — a column, an operator and a value — and a row has to match all of them, e.g. status = pending. Operators: equals, is not, greater than, at least, less than, at most, like, is one of, is empty and is not empty. HostWebhook writes the SQL: the names are quoted and the values travel apart from the SQL, so a {{payload.x}} can never become part of it.
  • Database and Table are picked from the list, or typed once. They don't take {{ }} templates, so the data of an event can't choose where the node acts; the same goes for a filter's column and operator. A filter's value, Rows, Values and Parameters do.
  • Update rows and Delete rows need at least one filter, so they never touch the whole table by mistake. A filter that matches more than 1,000 rows is refused before anything changes: narrow it, or use Run SQL.
  • Get rows: Columns empty means all; Order by takes a column and Direction says newest first or oldest first; Limit is 1 to 1,000, and 100 by default.
  • Rows (Insert, Upsert) is one JSON object per row, or a list of up to 500, and takes templates: {"email": "{{payload.email}}"}. Values (Update) is only the columns you change: {"status": "shipped"}.
  • Upsert rows uses the table's primary key, or the first unique key whose columns every row carries. Columns to update when the key exists is empty for all of them except the key.
  • Update, Upsert and Delete need a key. A table without a primary key or a unique key is refused: “This table has no primary key, so HostWebhook can't tell its rows apart. Use Run SQL.” HostWebhook reads the keys first (inside a transaction, SELECT … FOR UPDATE) and then changes by key, so it can give you the rows even though MySQL has no RETURNING. Update and Delete give back the first 100 rows.

Row operations come back as { rows: [...], rowCount }: the next node runs once per row. Dates come as MySQL writes them, with no time zone in between; a BIGINT or a DECIMAL comes as text, so it never changes in transit; a JSON column comes as an object; a BLOB or BINARY comes as { "$base64": "…" }, marked so nobody mistakes it for text. A TINYINT(1) comes as a number, which is what it is in MySQL.

⚠Insert, Update, Upsert, Delete and Run SQL change your database. Run Test really adds, changes or deletes. Get rows only reads. MySQL's affectedRows on an Update counts the rows that matched; changedRows counts the ones that actually changed.

Run SQL

One statement, never several. Write values as {{payload.id}} and HostWebhook sends them as question marks, apart from the SQL:

sqlValues in {{ }} are sent safely
SELECT * FROM orders WHERE id = {{payload.id}}

Put the {{ }} outside quotes — WHERE id = {{payload.id}}, not WHERE id = '{{payload.id}}' — and don't mix them with question marks of your own: HostWebhook turns each one into a question mark by itself.

Or fill Parameters by hand — a JSON list for the question marks, e.g. ["paid", 100] — and then {{ }} inside the SQL is refused: a flow started from a public URL must not choose the SQL. Return rows is on for a SELECT and off for a statement that only changes data; Time limit is 10 seconds by default, with your plan as the ceiling. A SELECT stops at the limit; for anything else the limit applies on HostWebhook's side and the statement is cancelled. Run SQL doesn't say which rows it changed, and transactions of several statements aren't supported.

When MySQL says no

  • The user or the password was rejected. “MySQL rejected the user or password. Reconnect the credential.” The credential asks to be reconnected: its Reconnect button opens Edit keys and settings. Its triggers pause.
  • The user can't do that. “The MySQL user can't do that on this table. Give it the privilege, or use another user.”
  • A table or a database that isn't there. “Table shop.orders doesn't exist. Pick another in the node.”
  • A row already exists. “A row with that key already exists.” On Insert it adds “Use Upsert rows to update it.” It never repeats the value.
  • The certificate can't be checked. “The certificate couldn't be checked. Paste your provider's CA, or connect through a HostWebhook tunnel.” Or “The certificate is for another host name. Use the name the certificate is for as the host, or connect through a HostWebhook tunnel.”
  • The server can't be reached. “Couldn't reach the MySQL server. Check the host and port, and that HostWebhook's addresses are allowed.”
  • A private host. “HostWebhook only connects to public hosts. For something on a private network, use a tunnel.”
  • Busy. “MySQL has too many connections open. Try again in a moment.” or “MySQL was busy with another change. Try again.”

A failed step shows only HostWebhook's own line and MySQL's error number. The SQL, the values and the rows that clashed are never saved in your run history or shown to an AI.


AI toolkit mode

Once the credential is picked, the node asks for a Mode. AI toolkit turns it into 8 tools that an AI Node — or an MCP client, through one of your MCP servers — calls by name: an assistant that looks up an order or files a new one. The tools write no SQL of the model's: HostWebhook writes it, with the names quoted and the values apart.

ToolArgumentsAt the start
describe_mysql_tablestable?Open
select_mysql_rowstable · columns? · filters? · order_by? · order_direction? · limit?Open
insert_mysql_rowstable · rowsOpen
update_mysql_rowstable · filters · valuesOpen
upsert_mysql_rowstable · rows · update_columns?Open
delete_mysql_rowstable · filtersBlocked
query_mysqlsql · params?Blocked
execute_mysql_sqlsql · params?Blocked

What you control

  • Tables the AI can use. One per line, e.g. orders. The AI touches only these. Empty means none: until you add a table, its tools refuse. A table in another database is written database.table; without one it is the node's database. The AI knows what it can use: the refusal names the tables on the list, and describe_mysql_tables gives their columns and types, so it doesn't have to guess.
  • Blocked tools. delete_mysql_rows (it can't be undone), execute_mysql_sql (any statement, including schema changes, on any table the user can reach) and query_mysql start blocked: turn one on only if the agent should. In MCP, deleting rows and Execute SQL go through run_destructive_operation; query_mysql only reads, so it goes through run_read_operation, and it stays blocked until you unlock it. Block any other under Block these tool calls.
  • query_mysql reads any table the database user can read, not only the ones on the list. It runs in a read-only transaction with one statement and a time limit, and the database rejects anything that writes, but the limit of what it reads is the user's privileges (see the MySQL user). That is why you unlock it knowingly.
  • Characters per call sent to the model. 20,000 by default, anything from 1,000 to 200,000. A list of rows is cut at 100,000 characters whatever you set.

What goes back to the model

  • The same answer as the operation. Select gives up to 200 rows (100 unless the model asks for more), whatever the node's Limit; Insert and Upsert take up to 100 rows per call.
  • An answer longer than the characters limit is cut there as text, with a note telling the model.
  • The rows are data from your database, not instructions. HostWebhook tells the model so, but a model can still be fooled by text in a row: block the tools it doesn't need.
  • If a flow reads rows and a later AI step uses them, they go to that AI: see MySQL data and AI.

Testing a tool

⚠Only a tool call picks the tool. In AI toolkit mode, only an AI Node, an MCP client or a voice agent chooses which tool the node runs. Run Test, a flow or a webhook run the operation saved on the node: an operation in their payload that names another tool is refused.
✦To try a tool, call it from an AI Node or from an MCP client. Its arguments look like this:
jsonA tool call
{ "operation": "select_mysql_rows", "table": "orders", "filters": [{ "column": "status", "operator": "eq", "value": "paid" }], "limit": 10 }
⚠A node in toolkit mode is not part of the pipeline. Events arriving through connections made before you switched are refused — the node only runs the tool it is asked for.

The trigger

Pick MySQL as the service on a Trigger node, with a MySQL credential. It checks one table on a timer and sends each new or changed row to the flow, once. It reads with the credential's user and writes nothing: it adds no triggers or tables to your database and needs no replication or server settings, so it works where those are closed, like PlanetScale or a hosting plan. Deactivating or deleting the trigger stops it.

What fires it

  • Database (empty means the credential's) and Table are picked from your server. The table needs a primary key, so the trigger can tell its rows apart.
  • Event Trigger is one of:
    • New rows — a row with created_at above the last one seen. Use created_at. A whole number (an id) works only if you tick Only my app sets this id: tick it only if nobody else can choose the id, because a row with a huge id would make the cursor jump far ahead and the trigger would pause. If unsure, use created_at.
    • Updated rows — a row whose updated_at moved past the last one seen. The column has to be a TIMESTAMP or a DATETIME that is set on every edit; the best one is declared ON UPDATE CURRENT_TIMESTAMP, because MySQL itself moves it. Give the creation column too (usually created_at): a row touched within 2 seconds of being created doesn't count as changed, so adding a row doesn't fire this event. Without it, a new row counts as changed.
  • Time zone of this date appears when the cursor is a DATETIME; a TIMESTAMP or a number doesn't need it. A DATETIME carries no time zone, so HostWebhook has to know which clock to wait for. Server time zone: the database fills it, e.g. DEFAULT CURRENT_TIMESTAMP. UTC: your app fills it, e.g. Laravel, Rails or Prisma. Not sure, the default, is safe, but rows may arrive hours late; a wrong pick can miss rows. If the newest row is dated ahead of the clock the trigger waits for, the trigger tells you, with the clock to pick.
  • Filters are optional: only rows that match all of them.
  • Rows per check is the most rows one check sends to the flow: 100 by default, up to 500. If more arrived, the next check continues where this one stopped.
  • Check every is in seconds: 300 (5 minutes) by default, as short as 60 (1 minute) on a paid plan and 900 (15 minutes) on Free; up to 86,400 (a day). Put an index on the cursor column: without one, every check reads the whole table, and the trigger says so.
  • Only rows that arrive after you activate it fire the flow; the cursor starts at the table's latest row. If the table is empty when you activate it, every row that arrives later fires the flow, oldest first.
ℹDeleted rows aren't seen. MySQL doesn't tell a check about a row that is gone. To react to a deletion, mark the row instead of deleting it — a deleted_at column that your app sets, along with updated_at — and watch Updated rows.

Ignore changes made by this flow

On by default. Rows this flow writes with Insert, Update or Upsert rows don't fire it, so a flow that changes the table it watches doesn't start itself forever. HostWebhook remembers each row as the flow left it and skips only that exact version, so an edit by someone else a moment later does fire. It needs a primary key on the table: without one the trigger won't start. Only the same connection counts. Run SQL isn't covered: MySQL doesn't say which rows a statement changed, so the trigger may fire on them. If HostWebhook can't remember a row the flow wrote, the run says so and the trigger may fire on it: it errs on firing too often, never too little.

What the trigger sends downstream

{
  "event": "row.created",
  "database": "shop",
  "table": "orders",
  "row": { "id": 1042, "status": "new", "total": "59.97", "created_at": "2026-11-05 10:00:00" },
  "cursor": "2026-11-05 10:00:00"
}

event is row.created for New rows and row.updated for Updated rows. database is the one the trigger watches: if you left it empty, the credential's. A Test push before you activate shows null. row is the whole row, with the same types as the node gives them (dates as MySQL writes them, a BIGINT or a DECIMAL as text); use {{payload.row.status}}. cursor is the value of the cursor column for that row. Each row runs once: HostWebhook doesn't send it again if a check repeats.

Trying it out

The trigger's Test push shows the latest rows it would pick up (up to 10), as they will arrive, so you can write {{payload.row.status}} in the nodes below it from the start. Nothing is sent to the flow.

Health check and pauses

The trigger's health check reads the table and its columns, never rows. If the user or the password stops working, every trigger of that credential is paused and the card says why — “Paused: MySQL rejected the user or password. Reconnect the credential.” — and the credential asks to be reconnected. These pause only that trigger, each with its own line:

  • A table or a column it watches isn't there anymore: “Pick it again.”
  • The user can't read the table: give it SELECT on that table, or use another user.
  • Five failed checks in a row.
  • More rows than the limit share the same cursor value, with no primary key to tell them apart: add one, or raise Rows per check.
  • The cursor jumped far ahead, maybe from a row with a huge id: use created_at.

Fix the cause and turn it on again; it continues where it stopped.

MySQL data and AI

Rows from your database are your own data, so HostWebhook doesn't hide them from AI the way it hides Google user data. If a flow reads them and a later step uses AI — the AI Node with your own provider credential, Hermes, our in-app assistant, Claude through the connector, an MCP client you connect, or a voice agent — what the flow read goes to that AI, under its terms. Decide which tables an AI toolkit may touch, and what your flows send on. What a flow reads stays in your run history for your plan's retention period and is then deleted.

Limits

WhatHow much
Connecting10 seconds
ConnectionsOne pool for each credential and database, from 1 to 3 connections for each organization, closed after 60 seconds without use
Reading rowsUp to 1,000 rows, and 5 MB of answer
Writing rowsUp to 500 rows for each Insert or Upsert; Update and Delete refuse a filter that matches more than 1,000 rows
One statement10 seconds by default, up to 2 minutes if your plan allows it
The AI toolkitUp to 200 rows for each call and 100 for each insertion
The triggerChecks every 300 seconds (5 minutes) by default, down to 60 seconds on a paid plan (900 on Free) and up to 86,400 (a day); 100 rows for each check by default, up to 500; Test push shows up to 10 rows

Gotchas

  • Seconds. A TIMESTAMP or DATETIME keeps seconds unless it was declared with fractions, e.g. DATETIME(6): many rows can share the same second.
  • MariaDB and MySQL differ in small ways (the upsert syntax, RETURNING); the node asks the server which one it is and uses the right form.
  • A DATETIME has no time zone. If it is the trigger's cursor, tell the trigger which clock fills it (Time zone of this date): a wrong pick can miss rows, and Not sure can make them arrive hours late.
  • Run SQL doesn't say which rows it changed. The other operations do, and so the trigger can ignore what this flow wrote.
  • If you change the password in your database, the nodes fail with the user-or-password line and the credential asks to be reconnected.
  • A schema change (a renamed table or column) is only noticed when a node or a trigger uses it again: it fails with the name of what is missing.

MySQL is a registered trademark of Oracle and/or its affiliates. HostWebhook works with MySQL and is not affiliated with, endorsed by or sponsored by Oracle.