Testing Mwaa Workflow
AWSOfficialPublished by AWS
- Skill
- Workflow
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a robust, end-to-end testing framework for Amazon MWAA workflows, supporting both Provisioned (Python DAGs) and Serverless (YAML) environments. It manages the entire lifecycle of a test run: verifying readiness, triggering execution, polling for completion, and handling failures. When a test fails, the skill integrates with debugging and authoring skills to diagnose issues, apply fixes, and perform retests, ensuring a closed-loop resolution process.
What it does
- Verifies workflow readiness before triggering to prevent premature execution.
- Triggers test runs for both Provisioned and Serverless MWAA environments.
- Polls runs to terminal states using adaptive intervals based on elapsed time.
- Implements a safety gate requiring user confirmation for production-like environments.
- Delegates root-cause diagnosis to debugging-mwaa-workflow upon failure.
- Coordinates with authoring-mwaa-workflow to apply fixes and perform retests.
When to use it
- When you need to verify that a newly deployed DAG or workflow is functional.
- To perform smoke tests on a pipeline after deployment.
- When you want to automate the cycle of testing, diagnosing, and fixing workflow failures.
- To ensure a workflow is parse-ready and executable before production use.
Advantages
- Reduces manual effort by automating the test-debug-retest loop.
- Ensures safety through explicit confirmation gates for production environments.
- Provides consistent, standardized testing logic across different MWAA flavors.
- Prevents stale test results by enforcing freshness checks on runs.
Usage examples
- “test my DAG”
- The agent identifies the environment, verifies the DAG is ready, requests confirmation, and triggers a test run, monitoring it until completion.
- “smoke-test the pipeline”
- The agent performs an end-to-end test of the workflow, and if it fails, it automatically invokes the debugging skill to identify the issue.
- “verify my workflow runs”
- The agent checks the status of the specified workflow and executes a test run if the current state allows, reporting the final outcome.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/aws/testing-mwaa-workflow/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip testing-mwaa-workflow.zip -d .agents/skills
Documentation by AWS
Testing 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.
Test Amazon MWAA workflow execution end-to-end: trigger a run, poll it to a terminal state, and on failure drive a capped debug -> fix -> retest loop. This skill triggers and reads state only; it delegates every diagnosis to debugging-mwaa-workflow and every mutation (artifact edit, redeploy, environment create/update) to authoring-mwaa-workflow. Routes by flavor, then runs one shared spine.
Execution note — poll in discrete steps: whenever you wait for an AWS operation to reach a terminal or ready state, issue one status check per call and decide in your own loop whether to check again. Never block a single command or script on the wait (no
while+sleepuntil done), regardless of the operation or how long it takes.
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_skilltool: The skill is not installed on the local filesystem. You MUST fetch each reference viaretrieve_skillwith thefileparameter (e.g.file="references/provisioned-testing.md") and read the returned content. Do NOTfile_readthese paths locally — they do not exist on disk.Installed locally (e.g.
.kiro/skills/testing-mwaa-workflow/or~/.claude/skills/testing-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, Mode, and Complexity
Flavor (reuse debugging's logic)
An environment name resolvable via
aws mwaa get-environment-> Provisioned.A
workflow/...ARN or anyaws mwaa-serverlesscontext -> Serverless.Neither signal -> ask: MWAA Provisioned (Python DAG) or MWAA Serverless (YAML workflow)?
Invocation mode
Standalone — the user points at an existing, already-deployed target.
Delegated — authoring-mwaa-workflow deployed and handed over the resolved target (env name +
dag_id, or workflow ARN). Its "deploy and test now?" approval satisfies the first trigger confirmation only.
Complexity
Simple — target already deployed and known-ready -> skip to Step 2.
Standard — just deployed, readiness unknown -> full spine.
Complex — retest inside an active fix loop.
Step 1: Readiness Check (before the first trigger)
Confirm the artifact is deployed and parse-ready. Do not trigger blind. This step
is MANDATORY even when you plan to adopt an existing run — the readiness data
(last_parsed_time, is_active, has_import_errors) feeds the freshness gate
in Step 2.
Provisioned: confirm
dag_idpresent withhas_import_errors: false, then apply the version-aware ready check via the/dagscollection endpoint. Determine the poll window from the environment's configured scan interval: checkget-environment->AirflowConfigurationOptionsforscheduler.dag_dir_list_interval(AF2) ordag_processor.refresh_interval(AF3). If unset, default to 300s. Poll up to that interval + 30s at 15s intervals (the per-DAG endpoint can lag). On AF2 (REST API v1) requireis_active: true. On AF3 (REST API v2) theis_activefield does not exist — requireis_stale: falseinstead and never wait onis_active(it reads as absent/false forever). A DAG that is parsed but not yet ready will reject trigger attempts with an opaqueRestApiClientException. Not ready in time -> hand to debugging-mwaa-workflow.Serverless: confirm
WorkflowStatusisREADY(viaget-workflow --workflow-arn). Not ready -> hand to debugging-mwaa-workflow.
This readiness window is separate from the Step 3 run timeout. See references/provisioned-testing.md and references/serverless-testing.md for exact commands.
Step 2: Confirm, then Trigger (safety gate)
State the resolved target and classify its environment. Unless you are certain
it is a development/test environment (name or tags clearly indicate dev/test),
treat it as production: emit a prod warning and require explicit user
confirmation before triggering. If the target is confirmed production (name or
tags contain prod, prd, or production, or the user says so), require
explicit approval at every state-changing step — each trigger, re-trigger,
and clear/rerun — not just once. For a target you are certain is dev/test,
require explicit user confirmation before the first trigger and each
re-trigger.
This gate is already satisfied when the user has given explicit approval for the action: in delegated mode the authoring "deploy and test now?" approval covers the first trigger, and an explicit pre-authorization to trigger a specific run counts as that confirmation — do not re-ask when approval has already been given.
Before triggering, check for scheduler-created runs (see provisioned-testing reference). Apply the freshness gate before adopting any prior run:
Delegated mode: always trigger fresh. Prior runs predate the deployment by definition — do not adopt regardless of state.
Standalone mode: compare
run.start_dateagainstdag.last_parsed_timeread from the/dagscollection response the Step 1 readiness check already fetches (the collection returnslast_parsed_timeper DAG in both v1 and v2 — no per-DAG call needed). Ifstart_date < last_parsed_time, the run tested a prior artifact version — treat as stale, trigger fresh. Only adopt runs wherestart_date >= last_parsed_time.
For fresh, non-stale runs that pass the gate: if a run already exists for the target interval, adopt it instead of POSTing. Monitor through Step 3.
On a retest, all run identifiers must be fresh (Provisioned: both
dag_run_id and logical_date; Serverless: new start-workflow-run call).
Before re-triggering, confirm every prior run is terminal — a still-running
prior run can block the new one from starting.
See references for exact trigger commands and retest hygiene.
Step 3: Poll to Terminal
Poll the triggered run until it reaches a terminal state. See references for exact poll commands and error fallbacks.
Timeout handling:
Provisioned with
dagrun_timeoutset: if elapsed time exceedsdagrun_timeoutand the run is still not terminal, treat as failure -> Step 4. (dagrun_timeoutis a DAG-level Airflow parameter and does not apply to MWAA Serverless.)Serverless: poll until the service returns a terminal state — no caller ceiling is needed, because the MWAA Serverless service enforces its own run cap and surfaces it as the
TIMEOUTterminal state.Provisioned without
dagrun_timeout: there is no DAG- or service-level deadline, so agree a maximum wait with the user before polling (they know the DAG's expected runtime; default to 1h if they have no preference). Poll until terminal OR the maximum wait elapses. On reaching the cap, stop polling and report — do not silently mark it failed, and do not keep polling unbounded:Run
<run-id>has not reached a terminal state within the agreed<max-wait>. It may still be running — I have not failed it. Choose: (a) extend the wait, (b) inspect logs / the Airflow UI, or (c) treat this test as inconclusive.
Poll interval scales with elapsed time:
| Elapsed time | Poll interval |
|---|---|
| <= 5 min | 15s |
| > 5-15 min | 30s |
| > 15-30 min | 60s |
| > 30-60 min | 2 min |
| > 60 min | 5 min |
Pass = terminal SUCCESS only; no output-data inspection. On pass -> Step 6.
Step 4: On Failure, Delegate to Debugging
Hand the run identifiers to debugging-mwaa-workflow. It returns its standard structure (Root Cause / Impact / Immediate Fix / Prevention / Commands). Do not re-diagnose here.
Step 5: Classify Fixes and Loop
5a. Classify each action item debugging returns into one bucket:
| Bucket | Examples | Handling |
|---|---|---|
| ARTIFACT | wrong operator param, missing import, bad YAML schema/timedelta, wrong task wiring, Serverless code-package fix (missing dep / wrong-platform wheel / bad zip layout) | Delegate to authoring-mwaa-workflow: regenerate the compliant artifact (and rebuild/redeploy the --code package for Serverless), then redeploy. Auto-continue. |
| ENVIRONMENT | requirements.txt dependency, plugins.zip, env config / worker sizing | Delegate to authoring's deploy path (owns env mutation + its own approval). Auto-continue after that gate. |
| HUMAN-GATED | new IAM permission, VPC/networking, missing data asset, quota increase | Cannot be auto-applied. Present exact commands, pause the loop, wait for the user to confirm resolution before any retest. |
Testing never mutates directly.
5b. Re-test. After an auto-fixable bucket is applied and redeployed, loop
back to Step 1 (redeploy triggers a fresh S3-sync/parse) -> Step 2 (re-confirm)
-> Step 3. Apply Step 2's re-trigger hygiene: fresh dag_run_id and
logical_date, and confirm the prior run is terminal (not just still
retry-backing-off) before the new trigger.
5c. Mixed action items in one cycle (parallel). Kick off the auto-fixable fixes (regenerate + redeploy via authoring) and present the human-gated items at the same time; do not fully serialize. Two guardrails: (1) gate the retest on both completing — do not re-trigger until auto-fixes are redeployed and the user confirms the human-gated items; (2) if an auto-fix depends on a human-gated item (the regenerated artifact references a resource/permission the user must create first), sequence them instead of parallelizing.
5d. Loop cap and stop conditions. The cap counts attempts without progress, not raw attempts — default 3 (override "retry up to N"). Define progress as either: a task that failed before now reaches SUCCESS (the pipeline advanced), or debugging reports a different root cause than the prior attempt. An attempt that makes progress resets the counter — a multi-task pipeline that clears one blocker per run is advancing, and a hard raw-count cap would abandon it mid-repair. Stop and summarize when any of: (1) run reaches SUCCESS -> Step 6 pass; (2) the no-progress counter hits the cap; (3) a HUMAN-GATED item -> pause for the user. Two consecutive runs with the same root cause count as one no-progress increment each — that is the counter advancing, not a separate rule.
Step 6: Report
Test Result: PASS | FAIL | STOPPED (<reason>)
Target: <env-name + dag_id | workflow ARN> [PROD WARNING if applicable]
Attempts: <n>/<cap>
Run History:
Attempt 1: <run_id> -> <state> (<duration>) [-> root cause if failed]
Fixes Applied: <artifact/env fixes auto-applied via authoring, per attempt> | none
Outstanding Action Items: <human-gated items, exact commands> | none
Next Step: <re-invoke to retest after resolving | passed, nothing needed>PASS requires terminal SUCCESS. STOPPED covers cap-reached / no-progress / human-gated-pause, each named explicitly.
Gotchas
A freshly deployed artifact is not immediately runnable — it must sync from S3 and parse (Provisioned) or was validated at create/update (Serverless). Step 1 is mandatory before the first trigger unless complexity is Simple.
This skill never edits an artifact, changes requirements, or creates/updates an environment. Those are authoring-mwaa-workflow's job and carry its approval gates. Testing only triggers (confirmed) and reads state.
Pass is run-state SUCCESS only. Output-data correctness is out of scope.
Troubleshooting
| Symptom | Cause | Action |
|---|---|---|
DAG absent from GET /dags | S3-sync lag or import error | Hand to debugging-mwaa-workflow before triggering |
--path rejected / truncated | Path over 64 chars (https://docs.aws.amazon.com/cli/latest/reference/mwaa/invoke-rest-api.html) | Poll the collection path with --query-parameters |
RestApiClientException on poll | Web server unreachable | Fall back to DAGProcessing/Scheduler log groups |
RestApiClientException on dagRuns POST (empty message) | DAG not ready — AF2: is_active=false (activation incomplete); AF3: is_stale=true (is_active does not exist in v2) | Poll /dags collection until ready (AF2 is_active=true / AF3 is_stale=false); do not retry the trigger blind |
Manual run created but stuck in queued, never starts (AF3) | DAG is paused — AF3 does not execute manual runs while paused (AF2 does) | Unpause (PATCH /dags/<dag_id> {"is_paused": false}) then trigger; common right after an upgrade where DAGs are deployed paused |
Serverless get-workflow not READY | Still creating/updating or failed | Wait for READY; if FAILED, hand to debugging |
| Same failure two attempts running | Fix not addressing root cause | Stop at no-progress; summarize; do not burn the cap |
References
references/provisioned-testing.md — exact invoke-rest-api commands (readiness, trigger, poll), 64-char path limit, retest hygiene, log fallback
references/serverless-testing.md — exact mwaa-serverless commands (get-workflow, start-workflow-run, get-workflow-run), terminal states
Security Considerations
Triggers real runs (state-changing): every trigger and re-trigger requires explicit confirmation; prod-named targets get a warning first.
No autonomous mutation: the skill never edits artifacts, requirements, or environments and never changes IAM — those are delegated to authoring (with its own gates). Human-gated fixes pause the loop for user action.
No secret exposure: run and log inspection must not surface credentials or connection strings into output.
Files
- ATTRIBUTION.mdAdded by AutoGineer922 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md15.1 KiB
- references/provisioned-testing.md8.8 KiB
- references/serverless-testing.md1.4 KiB
LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · plugins/aws-data-analytics/skills/testing-mwaa-workflow · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- aws/agent-toolkit-for-aws
AutoGineer is not affiliated with or endorsed by AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download testing-mwaa-workflow.zip