Skip to content

AWS.MWAAServerless reference

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).

// init — bind the operation to the workflow
const getTaskInstance = yield* AWS.MWAAServerless.GetTaskInstance(workflow);
// runtime
const task = yield* getTaskInstance({
RunId: runId,
TaskInstanceId: taskInstanceId,
});
yield* Effect.log(`task ${task.TaskId}: ${task.Status}`);

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).

// init — bind the operation to the workflow
const getWorkflowRun = yield* AWS.MWAAServerless.GetWorkflowRun(workflow);
// runtime
const run = yield* getWorkflowRun({ RunId: runId });
yield* Effect.log(`run ${run.RunId}: ${run.RunDetail?.RunState}`);

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).

// init — bind the operation to the workflow
const listTaskInstances = yield* AWS.MWAAServerless.ListTaskInstances(workflow);
// runtime
const { TaskInstances } = yield* listTaskInstances({ RunId: runId });
for (const task of TaskInstances ?? []) {
yield* Effect.log(`${task.TaskInstanceId}: ${task.Status}`);
}

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).

// init — bind the operation to the workflow
const listWorkflowRuns = yield* AWS.MWAAServerless.ListWorkflowRuns(workflow);
// runtime
const { WorkflowRuns } = yield* listWorkflowRuns({ MaxResults: 10 });
yield* Effect.log(`found ${WorkflowRuns?.length ?? 0} runs`);

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).

// init — bind the operation to the workflow
const listWorkflowVersions =
yield* AWS.MWAAServerless.ListWorkflowVersions(workflow);
// runtime
const { WorkflowVersions } = yield* listWorkflowVersions();
const latest = WorkflowVersions?.find((v) => v.IsLatestVersion);

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).

// init — bind the operation to the workflow
const startWorkflowRun = yield* AWS.MWAAServerless.StartWorkflowRun(workflow);
// runtime
const run = yield* startWorkflowRun({
OverrideParameters: { date: "2026-07-15" },
});
yield* Effect.log(`started run ${run.RunId} (${run.Status})`);

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).

// init — bind the operation to the workflow
const stopWorkflowRun = yield* AWS.MWAAServerless.StopWorkflowRun(workflow);
// runtime
const stopped = yield* stopWorkflowRun({ RunId: runId });
yield* Effect.log(`run ${stopped.RunId} -> ${stopped.Status}`);

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.

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" },
});