Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

AWS Athena

Integration with Amazon Athena for running SQL queries on data stored in Amazon S3. Execute queries, retrieve results, and explore table metadata in your data lake.

Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

Connector
Authentication

AWS Athena

Credentials

AWS Athena

Connect to Amazon Athena using AWS credentials to run SQL queries on data in S3

Set up in AWS Athena

  1. In the AWS IAM console, create (or choose) a user with programmatic access and permissions for Athena, the underlying S3 locations, and AWS Glue Data Catalog (for example attach a policy such as AmazonAthenaFullAccess plus S3 read access).

  2. Create an access key for that user and copy the Access Key ID and Secret Access Key (the secret is shown only once).

Set up in StackAI

  1. Open Settings → Connections, add a connection, and select AWS Athena.

  2. Enter the credentials and connection details in the fields below.

  3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

Connection fields

StackAI field
Required
What to enter

AWS Region

Yes

AWS region where your Athena resources are located (e.g., us-east-1). Provider instructions.

AWS Access Key ID

Yes

AWS Access Key for an IAM user/role scoped to read-only Athena access. Grant only: athena:StartQueryExecution/Get*, glue:Get* on the target catalog, and s3:GetObject/ListBucket on the output location. Do NOT grant athena:CreateDataCatalog or broad S3 write. Provider instructions.

AWS Secret Access Key

Yes

AWS Secret paired with the Access Key ID above. Must belong to a read-only Athena IAM principal. Provider instructions.

AWS Session Token (Optional)

Optional / as applicable

AWS Session Token for temporary credentials (used with STS or IAM roles). Provider instructions.

Data Catalog (Optional)

Optional / as applicable

The name of the data catalog to use. Defaults to 'AwsDataCatalog' if not specified. Provider instructions.

Database Name (Optional)

Optional / as applicable

Default database for queries. Can be overridden per-action. Leave empty if creating a new database. Provider instructions.

Output Location

Yes

S3 location for query results (e.g., s3://your-bucket/athena-results/). Provider instructions.

Provider documentation: Setup reference.

Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

Use an action

  1. Add the required AWS Athena action to the workflow.

  2. Select a connection when the action requests one.

  3. Complete the required fields. Use the reference picker when a value comes from another workflow step.

  4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

Actions

Start Query Execution

Start executing a SQL query in Amazon Athena and get the query execution ID

Inputs

Field
Type
Required
Description

Query String

textarea

Yes

The SQL query to execute.

Database

string

No

The database to use for this query (optional).

Data Catalog

string

No

The data catalog to use for this query (optional).

Workgroup

string

No

The workgroup in which the query is run (optional).

Outputs

Field
Type
Description

Query Execution ID

string

The unique identifier for the query execution.

Get Query Execution

Get the status and metadata for a query execution in Amazon Athena

Inputs

Field
Type
Required
Description

Query Execution ID

string

Yes

The unique ID of the query execution to retrieve.

Outputs

Field
Type
Description

Query Execution ID

string

The unique identifier for the query execution.

Query String

string

The SQL query string that was executed.

Status

object

The status of the query execution.

Statistics

object

Statistics about the query execution.

Result Output Location

string

S3 location where query results are stored.

Get Query Results

Get the results of a completed query execution in Amazon Athena

Inputs

Field
Type
Required
Description

Query Execution ID

string

Yes

The unique ID of the query execution to retrieve results from.

Max Results

integer

No

Maximum number of results to return (1-1000).

Next Token

string

No

Token for pagination to get the next page of results.

Outputs

Field
Type
Description

Columns

array

Metadata about the columns in the result set.

Rows

array

The rows of query results.

Next Token

string

Token for pagination. If present, more results are available.

Get Table Metadata

Get detailed metadata about a table in Amazon Athena including columns, types, and properties

Inputs

Field
Type
Required
Description

Table Name

string

Yes

The name of the table to get metadata for.

Database

string

No

The database containing the table (optional).

Data Catalog

string

No

The data catalog to use (optional).

Outputs

Field
Type
Description

Table Name

string

The name of the table.

Columns

array

List of columns in the table with their types.

Table Type

string

The type of the table (e.g., EXTERNAL_TABLE, MANAGED_TABLE, VIRTUAL_VIEW).

Create Time

string

The time when the table was created.

Last Access Time

string

The last time the table was accessed.

Parameters

object

Additional table parameters and properties.

List Table Metadata

List all tables in the database with their metadata in Amazon Athena

Inputs

Field
Type
Required
Description

Expression

string

No

A regex filter pattern for table names (optional).

Max Results

integer

No

Maximum number of tables to return (1-50).

Next Token

string

No

Token for pagination to get the next page of results.

Database

string

No

The database to list tables from (optional).

Data Catalog

string

No

The data catalog to use (optional).

Outputs

Field
Type
Description

Tables

array

List of table metadata summaries.

Next Token

string

Token for pagination. If present, more results are available.

Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.

Last updated

Was this helpful?