debugging-mwaa-workflow
aws/agent-toolkit-for-aws/plugins/aws-data-analytics/skills/debugging-mwaa-workflow/SKILL.md
Diagnoses and root-causes Amazon MWAA workflow failures across Provisioned (Python DAG) and Serverless (YAML workflow) environments. Provisioned uses aws mwaa invoke-rest-api, CloudWatch log groups, and get-environment; Serverless uses aws mwaa-serverless API (GetWorkflowRun, ListWorkflowRuns, GetTaskInstance) and CloudWatch logs. Covers failed runs and tasks, DAGs not appearing, import errors, worker OOM, IAM denials, and dependency drift. Triggers on: DAG failed, task failed, workflow run failed, MWAA error, debug my DAG, why did my workflow fail, DAG not showing up, MWAA import error, requirements failing, worker crashed, serverless run failed. Not applicable to authoring workflows (handled by authoring-mwaa-workflow), running or smoke-testing a workflow (handled by testing-mwaa-workflow), or CI-CD deploy failures.
What's in it
- Debugging MWAA Workflows
- Guardrail — where this skill's own files live (MCP vs local install)
- Step 0: Detect Flavor and Scope the Failure
- Detect flavor
- Route by complexity
- Step 1: Identify the Failure
- Step 2: Get Error Details and Categorize
- Step 3: Check Context (Why It Happened)
- Step 4: Provide Actionable Output
- Gotchas
- Troubleshooting
- References
- Security Considerations
---
name: debugging-mwaa-workflow
description: >
Diagnoses and root-causes Amazon MWAA workflow failures across Provisioned
(Python DAG) and Serverless (YAML workflow) environments. Provisioned uses
aws mwaa invoke-rest-api, CloudWatch log groups, and get-environment;
Serverless uses aws mwaa-serverless API (GetWorkflowRun, ListWorkflowRuns,
GetTaskInstance) and CloudWatch logs. Covers failed runs and tasks, DAGs
not appearing, import errors, worker OOM, IAM denials, and dependency drift.
Triggers on: DAG failed, task failed, workflow run failed, MWAA error, debug
my DAG, why did my workflow fail, DAG not showing up, MWAA import error,
requirements failing, worker crashed, serverless run failed.
Not applicable to authoring workflows (handled by authoring-mwaa-workflow), running or
smoke-testing a workflow (handled by testing-mwaa-workflow), or CI-CD deploy failures.
metadata:
version: "1"
---
# Debugging MWAA Workflows
> **AWS MCP server (optional but recommended):** running the AWS CLI commands in
> this skill through the AWS MCP server gives sandboxed execution and audit
> logging. Every command here also works with the plain AWS CLI, so the skill
> does not require the MCP server or any MCP-only tools.
Diagnose and root-cause Amazon MWAA workflow failures, then report root cause,
impact, and recommended remediation. Routes by flavor, then runs a shared
4-step diagnostic spine.
## Guardrail — where this skill's own files live (MCP vs local install)
This skill can be loaded two ways, and they resolve the skill's own bundled
files from different places. Determine how the skill was loaded before reading
a reference:
- **Loaded through the AWS MCP `retrieve_skill` tool:** The skill is not
installed on the local filesystem. You MUST fetch each reference via
`retrieve_skill` with the `file` parameter (e.g.
`file="references/failure-catalog.md"`) and read the returned content. Do NOT
`file_read` these paths locally — they do not exist on disk.
- **Installed locally** (e.g. `.kiro/skills/debugging-mwaa-workflow/` or
`~/.claude/skills/debugging-mwaa-workflow/`): Read the files from the local
skill directory using relative paths.
This distinction applies only to the skill's own packaged files. User data and
session artifacts are always read from and written to the user's working
directory. Never fetch or write customer data through `retrieve_skill`.
## Step 0: Detect Flavor and Scope the Failure
### Detect flavor
1. An environment name resolvable via `aws mwaa get-environment` means the
environment is **Provisioned**.
2. A `workflow/...` ARN or any `aws mwaa-serverless` context means the
environment is **Serverless**. A bare run identifier does NOT indicate
flavor — Provisioned DAG runs also have run ids.
3. If neither signal is present, ask: is the target **MWAA Provisioned (Python
DAG)** or **MWAA Serverless (YAML workflow)**?
### Route by complexity
- **Simple** — a single named task or run failed with a clear exception. Jump
to Step 2 for that task.
- **Standard** — a run failed and the cause is unknown. Run the full Step 1 to
Step 4 sweep.
- **Complex** — intermittent or environment-wide (multiple DAGs, "worked
yesterday", nothing appearing). Run the full sweep with emphasis on Step 3.
## Step 1: Identify the Failure
**Provisioned:** list failed DAG runs and task instances via
`aws mwaa invoke-rest-api` (paths `/dags/{id}/dagRuns` and
`/dags/{id}/dagRuns/{run_id}/taskInstances`). If `invoke-rest-api` errors
(`RestApiClientException`), fall back to the Scheduler and DAGProcessing log
groups. Get version and config from `aws mwaa get-environment`. See
[references/provisioned-diagnostics.md](references/provisioned-diagnostics.md).
**Serverless:** `aws mwaa-serverless list-workflow-runs`, then
`get-workflow-run`. Read `RunDetail.ErrorMessage` — an empty `TaskInstances`
with a parser message is a definition error; `Workflow execution failed` with
populated `TaskInstances` is a task-execution failure. See
[references/serverless-diagnostics.md](references/serverless-diagnostics.md).
## Step 2: Get Error Details and Categorize
Pull the real exception past boilerplate:
**Provisioned:** read the Task log group first, then Worker/Scheduler/
DAGProcessing as the symptom directs.
**Serverless:** `list-task-instances` then `get-task-instance` to get each
task's `LogStream`, then read that stream in CloudWatch.
Then categorize in priority order — `infra`, then `drift`, then `code-data` —
using [references/failure-catalog.md](references/failure-catalog.md). The
category determines the Step 3 checks.
## Step 3: Check Context (Why It Happened)
Run the context checks for the matched category from
[references/failure-catalog.md](references/failure-catalog.md). Do not stop at
the surface exception: a SIGKILL is an OOM story, a fresh import error on
unchanged code is a drift story, a sensor timeout is an upstream-health story.
## Step 4: Provide Actionable Output
Report in this exact structure:
```
Root Cause: <one-line diagnosis with the evidence that proves it>
Impact: <what failed, which runs, blast radius>
Immediate Fix: <the smallest change that unblocks>
Prevention: <the change that stops recurrence>
Commands: <exact read-only commands run, plus remediation commands for the user to run>
```
Run only read-only operations. Present state-mutating remediation
(clear/rerun/backfill for Provisioned; start-workflow-run or fix-and-redeploy
for Serverless) as commands for the user to run, with the impact stated. Never
execute them autonomously (production safety).
For the fix-and-redeploy path, use `authoring-mwaa-workflow` to regenerate a
compliant artifact.
## Gotchas
- Serverless has no Airflow web UI, no REST API, and no CLI token. Do not
attempt `create-web-login-token`, `invoke-rest-api`, or any Airflow REST
path for Serverless.
- For Provisioned, always use `aws mwaa invoke-rest-api` (not
`create-web-login-token` + curl). `invoke-rest-api` reaches VPC-only web
servers without network access.
- `GetWorkflowRun.RunDetail.ErrorMessage` distinguishes a definition error
(empty `TaskInstances`) from a task-execution failure (`Workflow execution
failed`, populated `TaskInstances`). Read it before pulling task logs.
- The Serverless log group defaults to `/aws/mwaa-serverless/{workflow-id}/`
but can be a custom group; confirm via `get-workflow` `LoggingConfiguration`
before assuming the path.
- A DAG not appearing has several causes — an import/parse error, the scheduler
scan interval (`scheduler.dag_dir_list_interval`, or `dag_processor.refresh_interval`
on Airflow 3.x) not yet elapsed, a `dag_id` collision, or S3-sync delay — and
is rarely a broken DAG. Check `GET /importErrors` and `GET /dags/{dag_id}` via
invoke-rest-api (and the DAGProcessing logs); see the failure catalog's
"DAG not appearing in the UI" checklist before concluding the code is wrong.
- A worker SIGKILL is an OOM signal. Recommend moving work to Glue/EMR/Lambda;
scaling workers alone does not fix per-task memory pressure.
- MWAA re-resolves dependencies on environment update, so an unchanged DAG can
start failing on import with no code change. Treat no-code-change import
failures as drift.
- Serverless `PythonOperator`/`BashOperator` tasks run custom code from a
`--code` package. A run that fails to extract the package or hits
`ModuleNotFoundError` is a packaging problem (wrong-platform wheel, missing
dep, bad layout), not a YAML definition error. See the failure catalog's
serverless custom-code section.
## Troubleshooting
| Error | Cause | Fix |
|-------|-------|-----|
| `RestApiClientException` (Provisioned) | Mis-scoped execution role or service error | Fall back to Scheduler/DAGProcessing log groups |
| `ResourceNotFoundException` on get-workflow-run | Wrong workflow ARN or run id | Re-list with list-workflow-runs |
| Task log stream empty (Serverless) | Wrong log group assumed | Read `LoggingConfiguration` from get-workflow |
| No task logs but run FAILED | Definition/parse error | Read `RunDetail.ErrorMessage`; fix the YAML |
## References
- [references/provisioned-diagnostics.md](references/provisioned-diagnostics.md) — Provisioned data sources and read-only commands
- [references/serverless-diagnostics.md](references/serverless-diagnostics.md) — Serverless API, log group, failure classes
- [references/failure-catalog.md](references/failure-catalog.md) — category-keyed context checks and remediation
## Security Considerations
- **Read-only by default**: diagnosis uses only read/list/describe calls.
Remediation (clear/rerun/backfill, IAM or key-policy changes) is presented as
commands for the user to run, never executed autonomously.
- **Least-privilege IAM**: when an `AccessDenied` is a genuine permission gap,
recommend the minimal `Action`/`Resource` from the error — never a wildcard;
distinguish it from a nonexistent-resource typo (do not broaden IAM then).
- **Cross-account**: KMS key-policy / assume-role changes are human-gated and
coordinated with the resource owner.
- **No secret exposure**: do not surface credentials or connection strings from
logs or API responses in the diagnosis output.
More agent context in aws/agent-toolkit-for-aws
186 other files this repository gives its agents, the first 60 shown.
Skill
- analyzing-release-readinessplugins/aws-agents-for-devsecops/skills/analyzing-release-readiness/SKILL.md
- chatting-with-aws-devops-agentplugins/aws-agents-for-devsecops/skills/chatting-with-aws-devops-agent/SKILL.md
- coordinating-multi-space-devops-agentplugins/aws-agents-for-devsecops/skills/coordinating-multi-space-devops-agent/SKILL.md
- diff-scanning-with-aws-security-agentplugins/aws-agents-for-devsecops/skills/diff-scanning-with-aws-security-agent/SKILL.md
- investigating-incidents-with-aws-devops-agentplugins/aws-agents-for-devsecops/skills/investigating-incidents-with-aws-devops-agent/SKILL.md
- pentesting-with-aws-security-agentplugins/aws-agents-for-devsecops/skills/pentesting-with-aws-security-agent/SKILL.md
- remediating-with-aws-security-agentplugins/aws-agents-for-devsecops/skills/remediating-with-aws-security-agent/SKILL.md
- running-release-testsplugins/aws-agents-for-devsecops/skills/running-release-tests/SKILL.md
- scanning-with-aws-security-agentplugins/aws-agents-for-devsecops/skills/scanning-with-aws-security-agent/SKILL.md
- setup-devops-agentplugins/aws-agents-for-devsecops/skills/setup-devops-agent/SKILL.md
- setup-security-agentplugins/aws-agents-for-devsecops/skills/setup-security-agent/SKILL.md
- setupplugins/aws-agents-for-devsecops/skills/setup/SKILL.md
- threat-modeling-with-aws-security-agentplugins/aws-agents-for-devsecops/skills/threat-modeling-with-aws-security-agent/SKILL.md
- agents-buildplugins/aws-agents/skills/agents-build/SKILL.md
- agents-connectplugins/aws-agents/skills/agents-connect/SKILL.md
- agents-debugplugins/aws-agents/skills/agents-debug/SKILL.md
- agents-deployplugins/aws-agents/skills/agents-deploy/SKILL.md
- agents-get-startedplugins/aws-agents/skills/agents-get-started/SKILL.md
- agents-hardenplugins/aws-agents/skills/agents-harden/SKILL.md
- agents-optimizeplugins/aws-agents/skills/agents-optimize/SKILL.md
- agents-payplugins/aws-agents/skills/agents-pay/packages/openclaw/skills/agents-pay/SKILL.md
- agents-payplugins/aws-agents/skills/agents-pay/SKILL.md
- amazon-bedrockplugins/aws-core/skills/amazon-bedrock/SKILL.md
- aws-ai-mlplugins/aws-core/skills/aws-ai-ml/SKILL.md
- aws-authplugins/aws-core/skills/aws-auth/SKILL.md
- aws-billing-and-cost-managementplugins/aws-core/skills/aws-billing-and-cost-management/SKILL.md
- aws-blocksplugins/aws-core/skills/aws-blocks/SKILL.md
- aws-cdkplugins/aws-core/skills/aws-cdk/SKILL.md
- aws-cloudformationplugins/aws-core/skills/aws-cloudformation/SKILL.md
- aws-computeplugins/aws-core/skills/aws-compute/SKILL.md
- aws-containersplugins/aws-core/skills/aws-containers/SKILL.md
- aws-databaseplugins/aws-core/skills/aws-database/SKILL.md
- aws-deploymentplugins/aws-core/skills/aws-deployment/SKILL.md
- aws-iamplugins/aws-core/skills/aws-iam/SKILL.md
- aws-messaging-and-streamingplugins/aws-core/skills/aws-messaging-and-streaming/SKILL.md
- aws-networkingplugins/aws-core/skills/aws-networking/SKILL.md
- aws-observabilityplugins/aws-core/skills/aws-observability/SKILL.md
- aws-sdk-js-v3-usageplugins/aws-core/skills/aws-sdk-js-v3-usage/SKILL.md
- aws-sdk-python-usageplugins/aws-core/skills/aws-sdk-python-usage/SKILL.md
- aws-sdk-swift-usageplugins/aws-core/skills/aws-sdk-swift-usage/SKILL.md
- aws-secrets-managerplugins/aws-core/skills/aws-secrets-manager/SKILL.md
- aws-securityplugins/aws-core/skills/aws-security/SKILL.md
- aws-serverlessplugins/aws-core/skills/aws-serverless/SKILL.md
- aws-storageplugins/aws-core/skills/aws-storage/SKILL.md
- aws-well-architected-reviewplugins/aws-core/skills/aws-well-architected-review/SKILL.md
- launch-with-awsplugins/aws-core/skills/launch-with-aws/SKILL.md
- signing-in-to-awsplugins/aws-core/skills/signing-in-to-aws/SKILL.md
- amazon-opensearch-serviceplugins/aws-data-analytics/skills/amazon-opensearch-service/SKILL.md
- authoring-mwaa-workflowplugins/aws-data-analytics/skills/authoring-mwaa-workflow/SKILL.md
- connecting-to-data-sourceplugins/aws-data-analytics/skills/connecting-to-data-source/SKILL.md
- creating-data-lake-tableplugins/aws-data-analytics/skills/creating-data-lake-table/SKILL.md
- exploring-data-catalogplugins/aws-data-analytics/skills/exploring-data-catalog/SKILL.md
- finding-data-lake-assetsplugins/aws-data-analytics/skills/finding-data-lake-assets/SKILL.md
- ingesting-into-data-lakeplugins/aws-data-analytics/skills/ingesting-into-data-lake/SKILL.md
- querying-data-lakeplugins/aws-data-analytics/skills/querying-data-lake/SKILL.md
- redshift-guideplugins/aws-data-analytics/skills/redshift-guide/SKILL.md
- storing-and-querying-vectorsplugins/aws-data-analytics/skills/storing-and-querying-vectors/SKILL.md
- testing-mwaa-workflowplugins/aws-data-analytics/skills/testing-mwaa-workflow/SKILL.md
- upgrading-mwaa-environmentsplugins/aws-data-analytics/skills/upgrading-mwaa-environments/SKILL.md
- agent-advisorplugins/aws-startup-advisor/skills/agent-advisor/SKILL.md
Discussion
Talked about elsewhere, linking to aws/agent-toolkit-for-aws
- Agent Toolkit for AWS
Hacker News · 5 points · Jun 8, 2026
- AIエージェントがAWS環境の構築や運用を効率よく行うための公式ツールキットらしい ClaudeやCursorなどのエージェントに導入して開発を自動化するのが楽しみ yug1224 starred aws/agent-toolkit-for-aws…
Bluesky · @yug1224.com · 2 likes and reposts · 1 replies · Jun 27, 2026
- Use official AWS and Google cloud skills
GitHub · yuru-sha/agent-capabilities · Oct 6, 2026
- GitHub - Webpage "GitHub - aws/agent-toolkit-for-aws: Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on…
Bluesky · @librecanada.bsky.social · 2 likes and reposts · May 10, 2026
- agent-skills.github.aws.agent-toolkit-for-aws: 0-unstable-2026-10-05 → 0-unstable-2026-10-06
GitHub · sudosubin/agents.nix · Oct 6, 2026
- AIエージェントにAWSの操作や開発をサポートさせるためのツールキットらしい 実務でAIを活用してインフラ構築を効率化するのに使えそう yug1224 starred aws/agent-toolkit-for-aws…
Bluesky · @yug1224.com · 1 likes and reposts · Jun 27, 2026
- AWS, 코딩 에이전트용 'aws-ai-ml' 스킬 공개 — SageMaker 추론 최적화·벤치마킹을 자연어로 (10/5)
GitHub · roomedia/ax-trend · Oct 5, 2026
- aws/agent-toolkit-for-aws: Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on AWS #devopsish
Bluesky · @chrisshort.net · 1 replies · May 8, 2026
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

