0
0
Apache Airflowdevops~10 mins

Managed Airflow (MWAA, Cloud Composer, Astronomer) - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Managed Airflow (MWAA, Cloud Composer, Astronomer)
Write DAG code
Upload DAG to Managed Airflow service
Service schedules DAG runs
Workers execute tasks
Monitor logs and status
Adjust DAG or resources as needed
This flow shows how you write a workflow, upload it to a managed Airflow service, which then schedules and runs tasks automatically while you monitor progress.
Execution Sample
Apache Airflow
from airflow import DAG
from airflow.operators.bash import BashOperator
from datetime import datetime

dag = DAG('example', start_date=datetime(2024, 1, 1), schedule_interval='@daily')
t1 = BashOperator(task_id='print_date', bash_command='date', dag=dag)
Defines a simple DAG with one task that prints the date, ready to be uploaded to a managed Airflow service.
Process Table
StepActionEvaluationResult
1Write DAG codeDefine DAG and tasksDAG object created with task 'print_date'
2Upload DAGPlace DAG file in service's DAG folderService detects new DAG
3Schedule DAGService scheduler triggers DAG run at or after start_dateDAG run created
4Execute taskWorker runs 'print_date' taskDate printed in logs
5MonitorCheck logs and status in UITask success confirmed
6AdjustModify DAG if neededChanges applied on next upload
💡 DAG run completes after all tasks finish successfully
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
dagNoneDAG object createdUploaded to serviceScheduled for runTask executedRun completed
Key Moments - 3 Insights
Why doesn't the DAG run immediately after uploading?
The execution_table row 3 shows the scheduler triggers the DAG run based on the start_date, so the DAG waits until that time to run.
How do I know if my task ran successfully?
Row 5 shows monitoring logs and status in the UI confirms task success, so checking logs is key.
What happens if I change the DAG code after upload?
Row 6 explains that changes apply on the next upload and next scheduled run, not immediately to running tasks.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does the worker execute the task?
AStep 4
BStep 2
CStep 3
DStep 5
💡 Hint
Check the 'Action' column for 'Execute task' in the execution_table
According to variable_tracker, what is the state of 'dag' after Step 3?
ADAG object created
BUploaded to service
CScheduled for run
DRun completed
💡 Hint
Look at the 'After Step 3' column for 'dag' in variable_tracker
If the start_date is set to a future date, when will the DAG run start?
AImmediately after upload
BAt the start_date time
CAfter the first task finishes
DNever
💡 Hint
Refer to execution_table row 3 about scheduling based on start_date
Concept Snapshot
Managed Airflow services let you upload DAG files that define workflows.
The service schedules and runs tasks automatically based on DAG settings.
You monitor runs via a web UI with logs and status.
Changes to DAGs apply on next upload and run.
Examples: AWS MWAA, Google Cloud Composer, Astronomer.
Full Transcript
Managed Airflow services simplify running workflows by handling scheduling and execution. You write DAG code defining tasks, upload it to the service, which then schedules runs based on your start_date. Workers execute tasks and you monitor progress through logs and UI. Changes to DAGs take effect on the next upload and scheduled run. This process helps automate complex workflows without managing infrastructure.