npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-aws-athena-query-with-workgroup

v0.2.1

Published

n8n community node for executing SQL queries on AWS Athena

Readme

n8n-nodes-aws-athena-query-workgroup

This is an n8n community node. It lets you execute SQL queries on AWS Athena in your n8n workflows with WorkGroup support.

AWS Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. With this node, you can run SQL queries against your data lake and incorporate the results into your n8n workflows.

Key Features:

  • WorkGroup Support - Configure and use specific AWS Athena workgroups for cost control and query management
  • Zero external dependencies - Uses native HTTP requests with AWS Signature V4 authentication
  • Lightweight and fast - No heavy SDK dependencies
  • Full Athena API support - Direct integration with AWS Athena REST API
  • Handles large result sets - Automatic pagination of results; optional configurable row limit

n8n is a fair-code licensed workflow automation platform.

Installation Operations Credentials Compatibility Usage Resources Credits

Installation

Follow the installation guide in the n8n community nodes documentation.

Install the package in your n8n root folder:

npm install n8n-nodes-aws-athena-query-with-workgroup

Operations

The AWS Athena Query node supports the following operations:

Query Execution

  • Execute SQL Query: Run SQL queries against your AWS Athena database
    • Supports SELECT statements for all table formats
    • Supports CREATE, INSERT, UPDATE, DELETE, MERGE INTO statements for Apache Iceberg tables only
    • Built-in SQL editor with syntax highlighting
    • Configurable query timeout
    • WorkGroup selection for cost management and query isolation
    • Results returned in structured JSON format

Credentials

You need to authenticate with AWS to use this node. Set up AWS credentials with the following permissions:

Prerequisites

  1. An AWS account with access to Athena
  2. An S3 bucket for query results storage
  3. Proper IAM permissions
  4. (Optional) AWS Athena workgroups configured

Required AWS Permissions

Your AWS credentials need to contain at least the following IAM permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "athena:StartQueryExecution",
                "athena:GetQueryExecution",
                "athena:GetQueryResults",
                "glue:GetDatabase",
                "glue:GetTable",
                "s3:GetBucketLocation",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:PutObject"
            ],
            "Resource": "*"
        }
    ]
}

Setting up Credentials in n8n

  1. Go to Credentials in your n8n instance
  2. Click Add Credential
  3. Select AWS from the list
  4. Enter your AWS credentials:
    • Access Key ID: Your AWS access key
    • Secret Access Key: Your AWS secret key
    • Session Token: (Optional) For temporary credentials

Compatibility

  • Minimum n8n version: 1.0.0
  • Tested with n8n versions: 1.0.0+
  • Implementation: Native HTTP requests with AWS Signature V4 authentication (no external dependencies)

Usage

Basic Query Example

  1. Add the AWS Athena Query node to your workflow
  2. Configure the following parameters:
    • Region: Your AWS region (e.g., us-east-1)
    • Database Name: Your Athena database (optional)
    • Workgroup: Your Athena workgroup (optional, defaults to primary)
    • SQL Query: Your SQL query
    • S3 Output Location: S3 path for results (e.g., s3://my-bucket/athena-results/)
    • Query Timeout: Maximum wait time in seconds (default: 300)

WorkGroup Configuration

The Workgroup parameter allows you to:

  • Control query costs by using workgroup-specific limits
  • Isolate queries by team or project
  • Apply consistent output locations and encryption settings
  • Monitor query metrics per workgroup

Example:

Workgroup: analytics-team

If left empty, the default workgroup (primary) will be used.

Sample SQL Query

SELECT
    customer_id,
    product_name,
    purchase_date,
    amount
FROM sales_data
WHERE purchase_date >= '2024-01-01'
ORDER BY purchase_date DESC
LIMIT 100

Important Note on Query Types

  • SELECT queries: Work with all table formats (Parquet, CSV, JSON, ORC, etc.)
  • INSERT/UPDATE/DELETE/MERGE: Only work with Apache Iceberg tables
  • For regular tables, AWS Athena is primarily a read-only query service
  • If you need to modify data, consider using Apache Iceberg table format

Output Format

The node returns results in the following structure:

{
  "queryExecutionId": "abc123-def456-ghi789",
  "rowCount": 25,
  "columns": ["customer_id", "product_name", "purchase_date", "amount"],
  "results": [
    {
      "customer_id": "12345",
      "product_name": "Widget A",
      "purchase_date": "2024-01-15",
      "amount": "29.99"
    }
  ]
}

Advanced Usage Tips

  • Large Result Sets: Results are paginated automatically (1000 rows per page, header on first page). Use the Max Rows Returned option to cap total rows without changing your SQL.
  • WorkGroup Benefits: Use workgroups to separate production vs development queries, apply data usage controls, and track costs per team
  • Partitioned Tables: Use partition predicates to improve query performance
  • Cost Optimization: Monitor your query costs in AWS Cost Explorer and use workgroup limits
  • Data Types: All values are returned as strings; use n8n's data transformation features to convert types as needed

Error Handling

The node handles common errors gracefully:

  • Query timeout errors
  • AWS permission issues
  • Invalid SQL syntax
  • S3 access problems
  • WorkGroup access denied

Enable "Continue on Fail" in the node settings to handle errors in your workflow logic.

Resources

Credits

This project is a fork of n8n-nodes-aws-athena-query by michaelqz.

Modifications in this fork:

  • ✨ Added WorkGroup parameter support for AWS Athena
  • 📝 Enhanced error handling and debugging
  • 🔧 Updated dependencies and build configuration
  • 📚 Improved documentation

Original project © 2024 Mike Zhou, InDebted - Licensed under MIT License.

Maintained by: Clément FERRERO (astro-cfo)