Connect a MySQL or MariaDB database once, and your flows can read, add, change and delete rows, run your own SQL, start when a row is added or changed, and let an AI node use your tables.
HostWebhook can do whatever the database user can do.
Give it a user of its own, with only what your flow needs (see step 01).
Connect your database
In HostWebhook, click Settings in the left sidebar, then Credentials, and start a new credential. Choose MySQL and give it a name.
- Marker 1: Host and Port: your server's address, like
mydb.abc123.us-east-1.rds.amazonaws.com, and its port. - Marker 2: TLS: Required encrypts the connection and checks the certificate.
- Marker 3: CA certificate: it depends on where your database lives (see the table). Here, a pasted one.
Fill in User and Password. Default database is optional: a node can pick another.
| Where it lives | CA certificate |
|---|---|
| PlanetScale and most providers | The usual public roots. Nothing to paste |
| Amazon RDS and Aurora | Amazon RDS / Aurora |
| Aiven, DigitalOcean, Google Cloud SQL | Paste a certificate, with the PEM your provider gives, like Aiven's ca.pem |
- Marker 1: TLS stays on Required.
- Marker 2: Amazon RDS / Aurora uses the AWS certificates HostWebhook already carries.
If your provider only lets in some addresses, add the IP the form shows under Allowlist this IP on your MySQL. Aiven calls it the IP address allowlist, DigitalOcean trusted sources, and RDS a security group.
Click Save MySQL connection. Saving doesn't connect, so open the credential and click Test connection. It answers with one line, like ✓ Connected (412ms) · MySQL 8.4.11 · TLS 1.3 · hostwebhook@%.
Give HostWebhook a user of its own
For a flow that reads and writes one table:
CREATE USER 'hostwebhook'@'%' IDENTIFIED BY 'a long password' REQUIRE SSL; GRANT SELECT, INSERT, UPDATE ON shop.orders TO 'hostwebhook'@'%';
Add DELETE only if a flow deletes. A trigger only needs SELECT on the table it watches. Leave out REQUIRE SSL if you connect with TLS Off.
Paste a URL instead
Click Paste a URL instead and paste a URL like mysql://user:password@host:3306/database. HostWebhook reads the host, port, user, password and database from it, plus the TLS setting, and refuses anything else. In a URL, ssl-mode=REQUIRED encrypts without checking the certificate, so it's refused: use ssl-mode=VERIFY_IDENTITY and, if your provider needs one, paste the CA.
Reach a private database (optional)
OptionalHostWebhook only connects to public hosts: localhost and private addresses are refused. For a database on your own network, run the tunnel agent next to it and leave it running:
npm install -g hostwh hostwh login hostwh expose-tcp --target localhost:3306 --id my-mysql
- Marker 1: How do we reach it: pick your tunnel. It has to say ONLINE.
- Marker 2: There's no IP to allow: your agent connects from inside your network.
- Marker 3: Host and Port: the ones of your agent's
--target, usuallylocalhostand3306.
User and Password are still needed: the tunnel moves the bytes, it doesn't log you in. Under TLS, choose Off: the tunnel already encrypts the connection (Required doesn't work through a tunnel yet).
Read rows
In Flows, add a MySQL node and open it. Pick your credential under MySQL connection, choose Single operation under Mode, and open Operation.
| Operation | What it does |
|---|---|
| Get rows | The rows of a table that match the filters, in the order you pick |
| Insert rows | Adds one or more rows, and gives back what it added |
| Update rows | Changes the columns you pick in every row that matches the filters |
| Upsert rows | Adds rows, or updates the ones that already exist with the same key |
| Delete rows | Deletes every row that matches the filters, and gives back what it deleted |
| Run SQL | Runs one SQL statement of your own |
Get rows is the one to start with. Run it to see your data.
- Marker 1: Table: the ones your user can see. Views are marked.
- Marker 2: Filters (optional): only rows that match all of them. Here,
statusequalspaid. - Marker 3: The output:
database,table,rowsandrowCount.
Dates come as MySQL writes them. A BIGINT or a DECIMAL comes as text, so it never changes on the way, like "total": "120.50". A JSON column comes as an object, and TINYINT(1) as 1 or 0.
The node after it runs once per row, and that row is its payload: use {{payload.status}}.
Change rows
Insert rows and Upsert rows take Rows: one JSON object per row, like {"email": "ana@example.com", "total": 120}, up to 500.
Update rows and Delete rows need at least one filter, so they never touch the whole table by accident.
- Marker 1: Update rows. The label says it writes.
- Marker 2: Filters: at least one. Here,
idequals{{payload.id}}, a value from the event (after a MySQL trigger,{{payload.row.id}}). - Marker 3: Values: only the columns you change, like
{"status": "shipped"}.
Insert, Update, Upsert, Delete and Run SQL change your database.
Run really adds, changes or deletes the rows. Try a filter with Get rows first to see which rows it matches.
Update, Upsert and Delete need a table with a primary or unique key. Otherwise the node says This table has no primary key, so HostWebhook can't tell its rows apart. Use Run SQL.
Run SQL is for what the others can't do: joins, schema changes and CALL. It takes one statement. Values in {{ }} are sent safely, like SELECT * FROM orders WHERE id = {{payload.id}}. Write them outside quotes.
Start a flow when a row is added or changed
MySQL can also start a flow. Add a Trigger node, choose MySQL as its service, pick your credential and the Table. The table needs a primary key.
- Marker 1: Event Trigger: New rows or Updated rows. Pick one. With a
created_ator anupdated_atcolumn, the cursor fills in by itself. - Marker 2: Ignore changes made by this flow: on, so the rows your own flow writes don't start it again. The line below counts the ones it skipped.
| Event | When it fires | Cursor |
|---|---|---|
| New rows | A row with a created_at above the last one seen | created_at |
| Updated rows | A row whose updated_at moved past the last one seen. A row touched within 2 seconds of being created doesn't count as changed | updated_at |
The Cursor is the column HostWebhook reads to know which rows are new. For Updated rows the best one is declared ON UPDATE CURRENT_TIMESTAMP, because MySQL moves it by itself. Put an index on it: without one, every check reads the whole table, and the trigger says so.
Time zone of this date appears when the cursor is a DATETIME. Choose UTC if your app fills it, like Laravel, Rails or Prisma, and Server time zone if the database does. With Not sure, the default, rows can arrive hours late, but none are lost. A wrong pick can miss rows.
When everything is set, click Activate. A trigger needs at least one connected node. Activating adds nothing to your database: HostWebhook checks the table every 5 minutes unless you choose otherwise (as often as every minute on a paid plan, every 15 minutes on the Free plan), and starts the flow once for each new or changed row. The rows that were already there don't fire it, and a row younger than a minute waits for the next check.
Test push shows the latest rows it would pick up. Nothing is sent and your flow doesn't run.
Deleted rows don't fire this trigger.
To react to a deletion, mark the row instead of deleting it, with a deleted_at column your app sets along with updated_at, and watch Updated rows.
Use what arrives
Everything the trigger sends is in payload, so the nodes after it can use it from the start:
{
"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. Use the columns like {{payload.row.status}}. The most common flow is a MySQL node after the trigger: Update rows with the filter id equals {{payload.row.id}} to mark the row as handled.
Run SQL can start the flow again.
Ignore changes made by this flow covers Insert rows, Update rows and Upsert rows with the same credential. MySQL doesn't say which rows Run SQL changed, so the trigger fires on them.
Let an AI node use MySQL (optional)
OptionalIn step 03, choose AI toolkit instead of Single operation. The node has 8 tools, such as select_mysql_rows and update_mysql_rows, and three of them start blocked. Add the others to an AI node from its Tools: Add Tool, then From Workspace.
- Marker 1: Tables the AI can use: only these. Empty means none. Type a name and click Add.
- Marker 2: 3 of 8 blocked: a blocked tool can't be used here by any AI node or MCP server.
Three tools start blocked.
delete_mysql_rows, query_mysql and execute_mysql_sql. Turn one on only if the agent should do that. query_mysql and execute_mysql_sql aren't limited by the list: they reach whatever the database user can.
The AI gets up to 200 rows per read. The rows of your tables can say anything, so a model can still be fooled by them, even though they are data, not instructions: block the tools it doesn't need.
If a flow uses AI (the AI node, Hermes or Claude), the rows it reads or changes go to that AI.
Reconnect after a password change
If the password changes in your database, the nodes fail with MySQL rejected the user or password. Reconnect the credential. and the triggers of that credential pause at their next check.
Open the credential and click Edit keys and settings. It is in the Keys and settings card and at the top of the page, and the Reconnect button of the warning, when there is one, opens it too. First you verify it's you, and then the form you connected with opens, filled in with what the credential has.
- Marker 1: Keys and settings: Edit keys and settings opens the form of the connection after you verify it's you.
Type the new password and click Save, and the nodes work at once. If you can't see the keys of the credential, the password box comes empty: an empty password keeps the one it has, but a new server or tunnel needs it typed again.
Then click Activate on each paused trigger. It continues where it stopped, so the changes made in between still arrive.
To disconnect MySQL for good, delete the credential in Settings, Credentials, and delete its user in your database.
Troubleshooting
The certificate couldn't be checked, or is for another host name. Pick the CA of your provider (step 01). For a server with its own certificate that doesn't carry its name, reach it through a tunnel (step 02) with Off. HostWebhook always checks the certificate: there is no mode that skips the check.
This connection skips the check of the server's certificate, or does not use TLS. A credential saved before with Required, no check, or with Off and no tunnel, isn't deleted, but it stops connecting and says so. Change it to Required, or to a tunnel, in Edit keys and settings (step 08).
Couldn't reach the MySQL server. Check the host and the port, and that your provider allows HostWebhook's IP.
Nothing connects through the tunnel. Check that the agent is running and that the tunnel says ONLINE. Run only one agent per tunnel.
The trigger paused and asks to pick the table again. A table or a column it watches isn't there anymore. Pick it again and click Activate.
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.