Actions6
- Database Actions
Database → Execute Query
AI-generatedSummary
Execute an arbitrary SQL query on a PostgreSQL database using AWS IAM authentication.
Inputs
- awsRegion (required) — The AWS region where the RDS instance is located.
- endpoint (required) — The RDS instance endpoint hostname.
- port (required) — The port number of the RDS instance.
- user (required) — The database user configured for IAM authentication.
- database (required) — The name of the database to connect to.
- query (required) — The SQL query to execute. You can use n8n expressions and $1, $2, $3, etc to refer to the 'Query Parameters' set in options below.
- options — Collection of execution options.
Output shape
Depends on queryBatching mode: 'single' returns query results or success metadata; 'transaction' executes all queries atomically with rollback on failure; 'independently' executes one query per incoming item, preserving item-level matching.
When queryBatching is 'single' and the query starts with INSERT, a runtime hint suggests changing queryBatching to 'Independent' to preserve item matching semantics.
Examples
Example 1: Run a parameterized SELECT query with independent batching.
Set queryBatching to 'independently' and provide comma-separated query parameters in queryReplacement.