Skip to main content

Amazon EMR Serverless ExecModule

Overview​

AwsEmrServerlessModule reads job run state from Amazon EMR Serverless. Use it to wait for a known Spark or Hive job before starting a downstream data task, find failed runs for an application, or collect queue and execution metrics for a particular run.

The module lists runs within one application and reads the details of one run. A separate upstream application or workflow step submits the jobs you monitor.

Usage​

  1. Create and verify an Amazon EMR Serverless connection in the Integration Account Console. Confirm the account is READY.
  2. Add Amazon EMR Serverless in Workflow Studio. Select the saved connection under General > Connection, then enter the AWS region and EMR Serverless application ID.
  3. Choose list_job_runs to discover runs, optionally filtered to a single state. Choose get_job_run if the previous step already supplies the run ID or if you need details about an item from the list.
  4. Check the module's top-level status. After a successful lookup, use data.state to decide whether to advance, wait, or route an exception.

Inputs​

InputTypeRequiredDefaultPurpose
operationstringYes—list_job_runs or get_job_run.
regionstringYes—AWS region hosting the application, for example us-west-2.
applicationIdstringYes—Application ID, 1–64 lowercase letters or digits.
statestringNo—Single list filter. Choose SUBMITTED, PENDING, SCHEDULED, RUNNING, SUCCESS, FAILED, CANCELLING, CANCELLED, or QUEUED. Omitting this field lists all states.
limitintegerNo25Maximum runs in one list page, from 1 through 50.
nextTokenstringNo—Continuation token from the preceding page, up to 1,024 characters. Pass the token unchanged.
jobRunIdstringFor lookup—Exact job run ID, 1–64 lowercase letters or digits.
attemptintegerNoLatestFor lookup, specify a positive attempt number or let AWS select the latest attempt.

Outputs​

OutputMeaning
status / operationModule outcome (success or error) and the recognized operation.
items / countRuns in provider order and their count on this page.
hasMore / nextTokenWhether another page exists and the token to request it.
dataNormalized job run details from get_job_run.
requestIdAWS request reference when available.
errorStable error code, redacted message, retryability, and HTTP status when available.

Each list item and lookup result includes applicationId, jobRunId, and state. When AWS supplies them, the module includes mode, attempt, createdAt, updatedAt, attemptCreatedAt, and attemptUpdatedAt. Timestamps are UTC ISO 8601 strings.

A lookup can also include startedAt, endedAt, queuedDurationMilliseconds, and totalExecutionDurationSeconds. The optional totalResourceUtilization and billedResourceUtilization objects contain any available vCPUHour, memoryGBHour, and storageGBHour values. Treat absent metrics as unknown. These are resource quantities reported by AWS, so calculating a currency amount requires separate pricing data.

IntegrationAccount Requirements​

Use the Amazon EMR Serverless 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 emr-serverless:ListJobRuns on the application ARN for list access. Grant emr-serverless:GetJobRun on the job run ARN or an application-scoped job run ARN pattern for lookup access. Use the AWS account and region that host the application. AWS IAM actions and resource ARN formats

Configuration​

The module uses the standard regional EMR Serverless HTTPS endpoint and signs requests with the saved AWS access key pair. Keep credentials in the connection. Inline credentials, session tokens, custom headers, and endpoint overrides are outside this connection contract.

Supply the application and job run IDs from the step that submits the job or from an inventory you control. Normalized outputs contain operational metadata and omit raw job driver configuration, execution roles, and detailed provider diagnostics.

Operations​

  • list_job_runs reads a single page for one application. Filter to a state such as FAILED to build a bounded triage list or omit the filter to see runs in all states. An empty page is a valid result. AWS ListJobRuns reference
  • get_job_run reads a known run in the specified application. Omit attempt to observe the latest attempt, or pass an attempt number to inspect that attempt. Schedule a later lookup if the workflow needs to wait for a terminal state. AWS GetJobRun reference

Errors and Failure Modes​

  • VALIDATION_ERROR indicates a missing or invalid input. INTEGRATION_ACCOUNT_ERROR indicates that the selected AWS connection cannot be used. Check the account status and protected fields.
  • If AWS rejects a request, check the region, the IDs, and the connection's scoped IAM permissions. Use the returned request ID when available to correlate the failure.
  • Temporary network failures and provider throttling can merit bounded retries. The SDK can retry a transient read up to twice. Use error.retryable to decide whether to schedule an additional workflow retry.
  • An invalid upstream response should preserve the last known run state. A successful lookup of a job in FAILED or CANCELLED is a job outcome and should follow the workflow's exception path.

Example​

A nightly transformation writes the data for a reporting refresh. The upstream job submission step hands the workflow an application ID and a job run ID. Before refreshing the report, check the exact run.

{
"operation": "get_job_run",
"region": "us-west-2",
"applicationId": "00fak3application",
"jobRunId": "00fak3jobrun"
}

A successful lookup of a completed run can return the following summary.

{
"status": "success",
"operation": "get_job_run",
"data": {
"applicationId": "00fak3application",
"jobRunId": "00fak3jobrun",
"state": "SUCCESS",
"mode": "BATCH",
"attempt": 1,
"startedAt": "2026-11-07T09:00:06Z",
"endedAt": "2026-11-07T09:03:06Z",
"queuedDurationMilliseconds": 6000,
"totalExecutionDurationSeconds": 180
}
}

On SUCCESS, start the downstream refresh. While the run is in a nonterminal state, schedule another check within the reporting window. On FAILED or CANCELLED, send the application and run IDs to the on-call workflow.

Notes​

  • If hasMore is true, pass nextToken unchanged with the same connection, region, application, state filter, and page size. Limit the number of pages and the total polling window.
  • Pace requests against the regional EMR Serverless endpoints and quotas. Space lookups across workflows that share an AWS account.
  • Both operations are read-only and safe to repeat. Run state can change between calls. Deduplicate alerts by application, job run, state, and attempt when available.
  • Job submission, cancellation, application management, and log retrieval are outside the connector's scope.