AWS.MWAAServerless reference
GetTaskInstance
Section titled “GetTaskInstance”Source:
src/AWS/MWAAServerless/GetTaskInstance.ts
Runtime binding for airflow-serverless:GetTaskInstance.
Reads the detail of a single task instance within a run of the bound
Workflow — its status, attempt number, timings, error message,
log stream, and XCom values. Provide the implementation with
Effect.provide(AWS.MWAAServerless.GetTaskInstanceHttp).
GetTaskInstance: Observing Tasks
Section titled “GetTaskInstance: Observing Tasks”// init — bind the operation to the workflowconst getTaskInstance = yield* AWS.MWAAServerless.GetTaskInstance(workflow);
// runtimeconst task = yield* getTaskInstance({ RunId: runId, TaskInstanceId: taskInstanceId,});yield* Effect.log(`task ${task.TaskId}: ${task.Status}`);GetWorkflowRun
Section titled “GetWorkflowRun”Source:
src/AWS/MWAAServerless/GetWorkflowRun.ts
Runtime binding for airflow-serverless:GetWorkflowRun.
Reads the detail of a single run of the bound Workflow — its
status, timings, error message, and task-instance ids. Provide the
implementation with Effect.provide(AWS.MWAAServerless.GetWorkflowRunHttp).
GetWorkflowRun: Observing Runs
Section titled “GetWorkflowRun: Observing Runs”// init — bind the operation to the workflowconst getWorkflowRun = yield* AWS.MWAAServerless.GetWorkflowRun(workflow);
// runtimeconst run = yield* getWorkflowRun({ RunId: runId });yield* Effect.log(`run ${run.RunId}: ${run.RunDetail?.RunState}`);ListTaskInstances
Section titled “ListTaskInstances”Source:
src/AWS/MWAAServerless/ListTaskInstances.ts
Runtime binding for airflow-serverless:ListTaskInstances.
Lists the task instances of a run of the bound Workflow with
their statuses and durations. Provide the implementation with
Effect.provide(AWS.MWAAServerless.ListTaskInstancesHttp).
ListTaskInstances: Observing Tasks
Section titled “ListTaskInstances: Observing Tasks”// init — bind the operation to the workflowconst listTaskInstances = yield* AWS.MWAAServerless.ListTaskInstances(workflow);
// runtimeconst { TaskInstances } = yield* listTaskInstances({ RunId: runId });for (const task of TaskInstances ?? []) { yield* Effect.log(`${task.TaskInstanceId}: ${task.Status}`);}ListWorkflowRuns
Section titled “ListWorkflowRuns”Source:
src/AWS/MWAAServerless/ListWorkflowRuns.ts
Runtime binding for airflow-serverless:ListWorkflowRuns.
Lists runs of the bound Workflow, optionally filtered to a
specific workflow version. Provide the implementation with
Effect.provide(AWS.MWAAServerless.ListWorkflowRunsHttp).
ListWorkflowRuns: Observing Runs
Section titled “ListWorkflowRuns: Observing Runs”// init — bind the operation to the workflowconst listWorkflowRuns = yield* AWS.MWAAServerless.ListWorkflowRuns(workflow);
// runtimeconst { WorkflowRuns } = yield* listWorkflowRuns({ MaxResults: 10 });yield* Effect.log(`found ${WorkflowRuns?.length ?? 0} runs`);ListWorkflowVersions
Section titled “ListWorkflowVersions”Source:
src/AWS/MWAAServerless/ListWorkflowVersions.ts
Runtime binding for airflow-serverless:ListWorkflowVersions.
Lists the versions of the bound Workflow (each update to the
workflow’s definition or configuration publishes a new version). Useful
for pinning StartWorkflowRun to a specific version. Provide the
implementation with
Effect.provide(AWS.MWAAServerless.ListWorkflowVersionsHttp).
ListWorkflowVersions: Observing Workflows
Section titled “ListWorkflowVersions: Observing Workflows”// init — bind the operation to the workflowconst listWorkflowVersions = yield* AWS.MWAAServerless.ListWorkflowVersions(workflow);
// runtimeconst { WorkflowVersions } = yield* listWorkflowVersions();const latest = WorkflowVersions?.find((v) => v.IsLatestVersion);StartWorkflowRun
Section titled “StartWorkflowRun”Source:
src/AWS/MWAAServerless/StartWorkflowRun.ts
Runtime binding for airflow-serverless:StartWorkflowRun.
Starts an on-demand run of the bound Workflow — the serverless
equivalent of triggering a DAG. The workflow ARN is injected from the
binding; the caller can override workflow parameters or pin a specific
workflow version. Provide the implementation with
Effect.provide(AWS.MWAAServerless.StartWorkflowRunHttp).
StartWorkflowRun: Running Workflows
Section titled “StartWorkflowRun: Running Workflows”// init — bind the operation to the workflowconst startWorkflowRun = yield* AWS.MWAAServerless.StartWorkflowRun(workflow);
// runtimeconst run = yield* startWorkflowRun({ OverrideParameters: { date: "2026-07-15" },});yield* Effect.log(`started run ${run.RunId} (${run.Status})`);StopWorkflowRun
Section titled “StopWorkflowRun”Source:
src/AWS/MWAAServerless/StopWorkflowRun.ts
Runtime binding for airflow-serverless:StopWorkflowRun.
Stops an in-flight run of the bound Workflow. Provide the
implementation with Effect.provide(AWS.MWAAServerless.StopWorkflowRunHttp).
StopWorkflowRun: Running Workflows
Section titled “StopWorkflowRun: Running Workflows”// init — bind the operation to the workflowconst stopWorkflowRun = yield* AWS.MWAAServerless.StopWorkflowRun(workflow);
// runtimeconst stopped = yield* stopWorkflowRun({ RunId: runId });yield* Effect.log(`run ${stopped.RunId} -> ${stopped.Status}`);Workflow
Section titled “Workflow”Source:
src/AWS/MWAAServerless/Workflow.ts
An Amazon Managed Workflows for Apache Airflow Serverless workflow — a serverless Airflow DAG defined by a YAML file in S3 and executed by AWS-managed, multi-tenant Airflow infrastructure without provisioning an environment.
Each update to the definition or configuration creates a new workflow version; MWAA Serverless keeps only the latest version actively scheduled.
Workflow: Creating a Workflow
Section titled “Workflow: Creating a Workflow”Basic Workflow
import * as MWAAServerless from "alchemy/AWS/MWAAServerless";import * as IAM from "alchemy/AWS/IAM";
const role = yield* IAM.Role("WorkflowRole", { assumeRolePolicyDocument: { Version: "2012-10-17", Statement: [{ Effect: "Allow", Principal: { Service: "airflow-serverless.amazonaws.com" }, Action: ["sts:AssumeRole"], }], },});
const workflow = yield* MWAAServerless.Workflow("Etl", { definitionS3Location: { bucket: "my-dag-bucket", objectKey: "workflows/etl.yaml", }, roleArn: role.roleArn,});Workflow with Logging and Tags
const workflow = yield* MWAAServerless.Workflow("Etl", { definitionS3Location: { bucket: "my-dag-bucket", objectKey: "workflows/etl.yaml", }, roleArn: role.roleArn, description: "nightly ETL", loggingConfiguration: { logGroupName: "/mwaa-serverless/etl" }, tags: { team: "data" },});