Stepthroughby Ynteractive Start free

Apache Airflow: Replace the Morning Sales Download with One Scheduled Dag

Practice it step by step

Start the free practice

You do every step yourself in a practice copy of Apache Airflow. It checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, about 8 minutes, and nothing touches your real accounts. Open full screen

Free · Live nowBusiness AutomationsApache Airflow~8 min8 stepsBeginner

Updated . Built from Apache Airflow’s official docs and help center. Screens may differ slightly in your account. How we check this lesson

Downloading yesterday's sales file and totaling it by store every morning takes half an hour, and the managers get nothing on the days that person is out. Apache Airflow is an open-source platform for developing, scheduling and monitoring workflows. You write a small Python file called a Dag, give it a schedule, and Airflow runs each task in order and shows you whether it worked. In this free starter lesson, built from Airflow's own docs, you are the data analyst at Fernhollow Markets, a made-up chain of 14 stores. 8 steps, about eight minutes, nothing to install to practice.

At a glance

QuestionAnswer
What you buildEvery morning someone downloads yesterday's sales CSV and totals it by store by hand. Write one small TaskFlow Dag that reads the file, totals it by store and writes the summary every day, then trigger it and read the Grid View, Graph View and task logs, all from Airflow's own docs.
ToolsApache Airflow
TimeAbout 8 minutes, 8 steps in 4 parts
LevelBeginner, no coding needed
CostFree
Ways to learn itPractice it step by step

The 4 parts, in short

  1. Start Airflow: Start Airflow on your computer.
  2. Write the Dag: Open a new Dag file, Paste the three-task Dag, Check the file parses.
  3. Run it: Enable the Dag, Trigger a run now.
  4. Check the result: Read the task logs in Grid View, Check the order in Graph View, then try it on your computer.

Next: browse every free Business Automations tutorial.

The business case: a morning report that depends on one person

Picture Priya, the data analyst at Fernhollow Markets, a made-up regional chain with 14 stores. Each morning a colleague downloads yesterday's sales CSV, totals it by store in a spreadsheet and sends the numbers to the store managers. It takes half an hour, mistakes creep in when the file layout changes, and on the days that colleague is out, no numbers go out at all.

With Airflow, Priya writes the same three steps once as a Dag: read the file, total it by store, write the summary. Airflow runs it every day and shows which step failed if something goes wrong.

Who this is for, and what you need

Data and BI analysts who run the same file-based report every day or week and are comfortable reading a short Python file. The practice runs in your browser with nothing to install. To do it for real you install Apache Airflow on your own computer by following the Quick Start page and start it with airflow standalone. Airflow is open source; its docs (read 16 November 2026) describe it as an open-source platform for developing, scheduling and monitoring workflows.

What this saves you

  • Half an hour every morning spent downloading and totaling a file.
  • Missed reports on the days the usual person is out.
  • Guessing what went wrong: each task shows its own status and logs.
  • What it does not do here: it does not email the managers. Email needs extra setup that this lesson does not cover, so the Dag writes a summary file you can share.

How this lesson was built

This is a starter lesson based on the Apache Airflow 3.4.0 docs (Quick Start; Pythonic Dags with the TaskFlow API; UI Overview; Dags; Airflow 101), read on 16 November 2026. The UI Overview does not give the exact label of the trigger button or the enable toggle; the lesson uses "Trigger Dag" from the TaskFlow tutorial and describes the toggle generically. The docs read do not cover sending email, so the third task writes a file instead. The practice screen is a plain frame, not a copy of Airflow, and the lesson was not run on a computer. Fernhollow Markets, its stores, file paths and numbers are made up.

Links

Try it yourself, free

Reading the steps is a start. Doing them is how it sticks. The interactive module walks you through every click in a practice copy of Apache Airflow, checks each step, and never touches your real accounts.

Start “Apache Airflow: Replace the Morning Sales Download with One Scheduled Dag”

Step by step: Apache Airflow: Replace the Morning Sales Download with One Scheduled Dag

All 8 steps of the interactive module, in order. In the module you watch each one, then do it yourself in a practice copy that checks your work.

1. Start Airflow

  1. Start Airflow on your computer. You are the data analyst at Fernhollow Markets, a made-up chain of 14 stores. Every morning someone downloads yesterday's sales file, totals it by store and sends it to the managers. You will make Airflow do that. With Airflow installed as the Quick Start describes, type the command that starts it.

    Every morning someone totals yesterday’s sales by hand. Start Airflow on your computer with airflow standalone.

2. Write the Dag

  1. Open a new Dag file. The UI is at http://localhost:8080, and you log in as admin with the printed password. Now create the Dag. Open a new Python file in your Dags folder.

    The UI is at localhost 8080.

  2. Paste the three-task Dag. Paste the Dag. schedule="@daily" runs it once a day. read_sales reads the CSV, summarise_by_store totals the amount column by store, and write_summary writes one line per store to a summary file. The last two lines wire the tasks in order and call the Dag function so Airflow finds it.

    It runs daily, reads the file, totals sales by store and writes a summary file.

    import csv
    from collections import defaultdict
    
    import pendulum
    
    from airflow.sdk import dag, task
    
    
    @dag(
        schedule="@daily",
        start_date=pendulum.datetime(2026, 11, 1, tz="UTC"),
        catchup=False,
        tags=["sales"],
    )
    def daily_store_sales():
        @task
        def read_sales():
            with open("/data/sales/yesterday.csv") as f:
                return list(csv.DictReader(f))
    
        @task
        def summarise_by_store(rows):
            totals = defaultdict(float)
            for row in rows:
                totals[row["store"]] += float(row["amount"])
            return dict(totals)
    
        @task
        def write_summary(totals):
            with open("/data/sales/store_summary.csv", "w") as f:
                f.write("store,sales\n")
                for store, total in sorted(totals.items()):
                    f.write(f"{store},{total:.2f}\n")
    
        write_summary(summarise_by_store(read_sales()))
    
    
    daily_store_sales()
    
  3. Check the file parses. Airflow 101 suggests running the file with Python first. If it runs without errors, Airflow can load it. Type the check for the file you just saved.

    Run the file with Python first. No errors means Airflow can load it.

3. Run it

  1. Enable the Dag. In the UI, open Dags. The TaskFlow tutorial says to find your Dag in the list and click the toggle to enable it. Turn on daily_store_sales.

    Find your Dag in the Dags list and click the toggle to enable it.

  2. Trigger a run now. You could wait for tomorrow's scheduled run, but test it now. Click Trigger Dag. The Dag Trigger Window offers Single Run or Backfill; a single run is what you want.

    Do not wait for tomorrow.

4. Check the result

  1. Read the task logs in Grid View. Grid View shows each task’s status for the run. The UI Overview says to click a task cell to view its logs. Click the summarise_by_store cell and read the Logs tab: 14 store totals, which match the summary file.

    In Grid View, click the summarise by store cell and read its logs. Fourteen store totals.

  2. Check the order in Graph View, then try it on your computer. Open Graph View to see the three tasks connected in order. This lesson was built from Airflow's docs, not run on a computer. To try it yourself, open the Quick Start page, install Airflow, run airflow standalone, then save this Dag with a small test CSV of your own and trigger it once before you trust the schedule.

    To try it yourself, start from the Quick Start page and run airflow standalone.

Frequently asked questions

What is Apache Airflow?
An open-source platform for developing, scheduling and monitoring workflows. You write each workflow as a Python file called a Dag, and Airflow runs its tasks in order on the schedule you set.
How do I run a Dag every day?
Set the schedule argument on the Dag, for example schedule="@daily". The Dags page of the docs also shows cron strings such as "0 0 * * *" and other values.
Where do I see whether a run worked?
Grid View shows each run and task's status. Click a task cell to view its logs, which include system output, error messages and traceback information. Graph View shows how the tasks connect.
Does Apache Airflow cost anything?
Airflow itself is open source. You run it on your own computer or server; the Quick Start starts everything with airflow standalone.
Was this lesson tested in a real Apache Airflow account?
No. It is a free starter lesson built from Airflow's public docs. The practice frame is generic and the labels come from those docs; check them against your own screen.

Start this module free

More in Business Automations

n8n AI Email Responder: Draft Gmail Replies Automatically: a step from the interactive modulen8n AI Email Responder: Draft Gmail Replies Automatically

Build an n8n agent that watches your Gmail, reads each new customer email, and writes a reply as a draft in the same thread, ready for you to check and send.

Free · Live ~12 min Intermediate

How to Make an n8n Workflow That Emails Each Tech Their Jobs from Sheets: a step from the interactive moduleHow to Make an n8n Workflow That Emails Each Tech Their Jobs from Sheets

Every morning at 7, n8n reads a plumbing company's jobs sheet, skips anything not assigned yet, and emails each job to the tech it's assigned to — customer, address…

Free · Live ~10 min Intermediate

The n8n inbox triage workflow: Gmail Trigger, a Text Classifier with Lead, Client and Invoice outputs wired to three label steps, then a Basic LLM Chain and Create a draft on the Client branchGmail AI Triage: Auto-Label Every Email and Draft Replies

Build an n8n workflow that reads each new email, sorts it as a lead, a client or an invoice with a Text Classifier, adds the matching Gmail label, and drafts a reply to…

Free · Live ~18 min Advanced

The n8n support agent: a chat trigger and an AI Agent with an OpenAI Chat Model, Simple Memory, a Google Docs tool and a Gmail toolHow to Use n8n to Build AI Agents: A Support Agent That Answers from Your Docs

Turn an n8n chat agent into a support agent that answers only from your policies in a Google Doc, refuses what it should, and hands off to a person by email.

Free · Live ~13 min Advanced

Chatbase's Agents page in a new workspace: No agents yet, with a New AI agent buttonChatbase: Answer Customer FAQs with an AI Agent

A business case for a small firm that answers the same customer questions every week: build a Chatbase AI agent on your FAQ in the real app, make it say when it does…

Free · Live ~15 min Beginner

Mixo editor with Show Signup Form ticked in the Hero section, and the preview showing an email box with a Get Started buttonMixo: Launch a Landing Page and Collect Early Sign-ups

A business case for a firm testing a new service before building it: describe the idea in one sentence, let Mixo build the page, turn on a sign-up form, publish it free…

Free · Live ~12 min Beginner

All 62 modules in Business Automations

Plain-English definitions, each with an example from a free lesson.

The full AI glossary

Browse related tutorials

Get the badge / embed this lesson