Actions62
- SQL Actions
- Client Access Actions
- User Access Actions
- Tools Actions
- HTML to PDF
- Markdown to PDF
- Text to PDF
- Merge PDFs
- Split PDF
- Extract PDF Text
- Resize Image
- Convert Image
- Compress Image
- Add Image Watermark
- Create Thumbnail
- Generate Barcode
- Read Barcode
- Validate CPF/CNPJ
- Format CPF/CNPJ
- Generate UUID
- Transform JSON
- CSV to JSON
- JSON to CSV
- Normalize Text
- Extract Regex Fields
- Validate JSON Schema
- Generate Hash
- HMAC Sign
- Base64 Encode/Decode
- JWT Decode
- Encrypt Text
- Decrypt Text
- Format Date
- Parse Date
- Add Business Days
- Format Currency
- Number to Words
- Build Socket Event Payload
- Validate Client Token
- Validate Agent Context
- Build SQL Request
- Parse SQL Rows
- Generate Access Request Summary
- Publish Socket Event
- Wait for Socket Event
SQL → Execute SQL
AI-generatedSummary
Execute SQL against the selected Plug agent using REST or Socket. Guided mode builds a sql.execute command from SQL and optional named parameters; Advanced mode accepts a JSON-RPC command, with the resolved client token injected where supported.
Inputs
- Channel — Select REST (default) or Socket. Socket supports streamed SQL output and has configurable local buffer limits.
- Input Mode — Select Guided (default) to provide SQL and named parameters, or Advanced to provide a raw JSON-RPC command.
- Agent ID — Override the target agent; otherwise the credential's Default Agent ID is used.
- Client Token — Override the client token; otherwise the credential's Default Client Token is used.
- Include Plug Metadata — When enabled (default), include a
__plugobject with channel, agent, request, and socket metadata. - SQL (required) — In Guided mode, provide the SQL to execute. Template markers must be resolved before execution; use
:nameplaceholders for named parameters. - Named Params JSON — In Guided mode, provide a JSON object mapping SQL
:nameplaceholders to values. Values may contain n8n expressions. - Raw JSON-RPC Command (required) — In Advanced mode, provide one JSON-RPC command object. The resolved client token is injected where supported.
- Response Mode — Choose Aggregated JSON (default), Aggregated Single Item, Chunk Items, or Raw JSON-RPC. Chunk Items applies to socket stream chunks; other combinations use aggregated output.
- Additional Options — Guided-mode settings include timeout, API version, command metadata, server timings, maximum parallel input items, maximum rows, execution mode, multi-result support, database, pagination, cursor, idempotency key, and whether UPDATE/DELETE statements must contain a WHERE clause. Prefer DB Streaming can request streaming for eligible SELECTs; Auto Performance Hints is enabled by default and can suggest socket streaming for large eligible SELECTs.
- Socket Options — For Socket channel, configure maximum locally buffered rows, bytes, and chunks, stream pull window size, relay fast path, and server timings. SQL execute commands omit relay fast path because they may open streams.
Output shape
One or more n8n items containing the SQL result,
Aggregated JSON returns rows as individual items when possible, otherwise one JSON item. Aggregated Single Item returns one item with
rowCountandrows[]for result sets. Chunk Items returns socket stream chunks as items when supported; other combinations fall back to aggregated output. Raw JSON-RPC returns the normalized RPC envelope. Metadata may be included under__plug; buffer limits can cause oversized socket responses to fail.
Examples
Example 1: Run a parameterized query in Guided mode and emit one item per row when possible.
Channel REST or Socket; Input Mode Guided; SQL uses :id placeholders; Named Params JSON maps id to an expression such as {{$json.id}}; Response Mode Aggregated JSON.
Example 2: Read a large result set over Socket without fanning out one item per row.
Channel Socket; Input Mode Guided; use an eligible SELECT; enable or rely on Auto Performance Hints for preferred database streaming; choose Aggregated Single Item or Chunk Items and set suitable socket buffer limits.
Example 3: Send a custom SQL JSON-RPC request.
Input Mode Advanced; provide a single JSON-RPC command in Raw JSON-RPC Command; choose the desired Response Mode.