Skip to content

Tunnel Query

The Tunnel Query node runs SQL queries against a remote MySQL database you cannot reach directly — the typical shared hosting where the MySQL port is closed and there is no VPN. Instead of connecting to port 3306, it sends the query over HTTPS to a tunnel.php file on that hosting, which runs it locally with PDO prepared statements.

It supports dynamic variables in the query ({{field}}, {{@NodeName.field}}, {{#N.field}}, {{var.name}}), so you can automate PHP/WordPress/WooCommerce sites on cheap hosting without exposing the database.

Setup first: to create and install your tunnel.php, follow the Tunnel Connector guide — it includes a wizard that generates your configuration.

ParameterTypeRequiredDescription
credentials_idcredentialsYesTunnel credential (tunnel.php URL + shared secret)
querycodeYesSQL query to execute (supports {{variable}})
databasetextNoOverrides the tunnel’s default database (multi-tenant, X-Tenant-DB header)

Credential type tunnel, with:

  • url: full URL of your tunnel.php (e.g. https://your-domain.com/floogos/tunnel.php)
  • secret: shared secret, ≥32 characters (matches TUNNEL_SECRET in tunnel.config.php)
  • database: (optional) default database
{
"nextModule": null,
"data": [
{ "id": 1, "name": "Example", "email": "test@test.com" }
],
"_meta": { "success": true, "rowCount": 1, "insertId": null }
}
{
"credentials_id": 1,
"query": "SELECT * FROM orders WHERE status = 'pending' LIMIT 100"
}

With dynamic variables:

{
"credentials_id": 1,
"query": "INSERT INTO customers (name, email) VALUES ('{{name}}', '{{email}}')"
}
  • Variables {{field}} become positional ? placeholders and are sent as params (prepared statements) — never string interpolation.
  • The tunnel allows SELECT / INSERT / UPDATE; DELETE only on whitelisted tables; DROP / ALTER / TRUNCATE / CREATE / GRANT and multi-statements are blocked; dangerous keywords (INTO OUTFILE, LOAD_FILE, SLEEP, BENCHMARK, mysql.user) are rejected.
  • Uses HTTPS (axios) with a configurable timeout (default 15000 ms).
  • A 403 usually means a wrong secret or an IP not allowed by the tunnel.