Amazon Redshift Data API ExecModule
Overview
AwsRedshiftModule monitors statements submitted through the Amazon Redshift Data API. Use it to check whether an upstream warehouse job has finished, investigate a statement that is taking longer than expected, or collect execution metrics before starting the next step in a reporting pipeline.
The module can list statement summaries visible to the current IAM session and inspect a known statement ID. Filter the list by status or by a statement name prefix set by the upstream application. Both operations read operational metadata. A separate application or workflow step submits the statements you monitor.
Usage
- Create and verify an Amazon Redshift Data API connection in the Integration Account Console. Confirm the account is
READY. - Add Amazon Redshift Data API in Workflow Studio. Select the saved account under General > Connection and set the AWS region where the statement ran.
- Choose
list_statementsto discover statements, with an optional status or statement name prefix. If an upstream step already supplies an ID, choosedescribe_statementand map the ID directly. - Check the module's top-level
statusfirst. After a successful description, branch ondata.stateto continue, wait, or route an exception.
Inputs
| Input | Type | Required | Default | Purpose |
|---|---|---|---|---|
operation | string | Yes | — | list_statements or describe_statement. |
region | string | Yes | — | AWS region where the statement ran, for example us-west-2. |
statementName | string | No | — | Case-sensitive prefix for listing named statements, from 1 through 2,048 characters. Supply a nonblank value without control characters, such as finance-refresh-. |
statementStatus | string | No | FINISHED | List filter. Supported values are SUBMITTED, PICKED, STARTED, FINISHED, ABORTED, FAILED, and ALL. |
limit | integer | No | 25 | Maximum statements in one list page, from 1 through 50. |
nextToken | string | No | — | Opaque continuation token returned with the preceding list page, up to 2,048 characters. |
statementId | string | For describe | — | Exact Data API statement ID. Use the returned lowercase UUID and include its numeric suffix for an individual batch statement when present. |
Outputs
| Output | Meaning |
|---|---|
status / operation | Module outcome (success or error) and the recognized operation. |
items / count | Statements in provider order and their count on this page. |
hasMore / nextToken | Whether another page exists and the token to request it. |
data | Normalized execution summary from describe_statement. |
requestId | AWS request reference when available. |
error | Stable error code, redacted message, retryability, and HTTP status when available. |
Each list item has a statementId and may include state, createdAt, and updatedAt. A description includes statementId and state, plus the same timestamps and any available durationNanos, resultRows, resultSizeBytes, and hasResultSet. Timestamps are UTC ISO 8601 strings. updatedAt represents the last update to the statement metadata. Treat absent metrics as unknown. resultRows may count returned rows or rows affected by a statement. hasResultSet may be true for an empty result set.
IntegrationAccount Requirements
Use the Amazon Redshift Data API template with account name AWS. Enter the access key ID in the protected API key field and the secret access key in the protected password field. Verify the account before selecting it in Workflow Studio. The workflow references the saved account, and the runtime resolves the protected fields for request signing.
Grant redshift-data:ListStatements for listing and redshift-data:DescribeStatement for a lookup. AWS lists no cluster or workgroup ARN resource type for these actions, so use the documented IAM policy conditions to constrain access. Review redshift-data:statement-owner-iam-userid where owner-based access is required. Test with the IAM identity that can read the statements produced by the upstream workload. AWS Redshift Data API permissions · AWS service authorization reference
Configuration
The connector uses the standard regional Redshift Data API HTTPS endpoint and signs requests using the selected account's access key pair. Store credentials only in the connection. Custom endpoints, inline credentials, and session tokens are outside this connection contract.
Start with a known statement ID or a small page of statements from the IAM identity that submitted them. Keep statement IDs and metrics in the workflow steps that need them. The normalized output excludes SQL, query parameters, raw diagnostic text, and nested batch statements.
Operations
list_statementsrequests a single page and setsRoleLeveltofalse, limiting the list to statements from the caller's current IAM session. ChooseALLto include in-flight and failed statements. For workloads that name their statements, enter a prefix such asfinance-refresh-to narrow the list. An empty page is a valid result. AWS ListStatements referencedescribe_statementreads the state of one known statement. Use it to look up a selected list item or follow an ID from the step that submitted the SQL. The operation returns the current observation. Schedule a later lookup if you need to wait for a terminal state. AWS DescribeStatement reference
Errors and Failure Modes
- A missing or invalid region, an invalid statement ID, or an invalid list filter fails validation. Correct the affected input and verify that the selected connection is
READY. - When AWS rejects a request, check the region, statement ownership, and the connection's IAM permissions. Use the returned request ID to correlate the failure with AWS support or logs when available.
- Throttling and temporary service failures can merit a bounded retry. Treat the
error.retryablehint separately from the execution state of a successful lookup. A successful response withdata.stateset toFAILEDstill calls for investigation of the statement. - If a response fails validation, treat it as an upstream response error and retain the last known workflow state.
Example
A finance reporting workflow receives the statement ID of an overnight warehouse refresh. Before notifying report consumers, read the statement summary.
{
"operation": "describe_statement",
"region": "us-west-2",
"statementId": "d9257a58-3ccd-4d31-aa9b-5bdf74304314"
}
A completed lookup can return the following summary.
{
"status": "success",
"operation": "describe_statement",
"data": {
"statementId": "d9257a58-3ccd-4d31-aa9b-5bdf74304314",
"state": "FINISHED",
"createdAt": "2026-11-07T09:00:00Z",
"updatedAt": "2026-11-07T09:00:08Z",
"durationNanos": 7312000000,
"resultRows": 12480,
"hasResultSet": false
}
}
Release the downstream task on FINISHED. For SUBMITTED, PICKED, or STARTED, schedule a later check within the reporting window. Route FAILED or ABORTED to the warehouse owner and include the statement ID.
Notes
- If
hasMoreis true, passnextTokenunchanged with the same account, region, filters, and page size. Bound the number of pages and the total polling window. - Pace calls against the AWS Redshift Data API quotas. Keep repeated lookups bounded and stagger schedules across workflows.
- Both operations are read-only and safe to repeat. Statement state can change between calls. Use the statement ID and state to deduplicate notifications.
- Cluster, workgroup, and database filters are outside the list operation's scope. Query submission, cancellation, result fetching, and warehouse configuration are outside the connector's scope.