Process Modeling: Flowcharts & DFDs

The Context Diagram (DFD Level 0)

18 min Lesson 5 of 10

The Context Diagram (DFD Level 0)

Before you can detail how a system works, you must define what the system is — where it begins and where it ends. The context diagram, also called DFD Level 0, answers that question in a single picture. It shows the entire system as one process, surrounded by the external entities that exchange data with it. No internal detail, no sub-processes, no data stores — just the system boundary and the flows that cross it.

For a systems analyst, the context diagram is usually the very first diagram produced after requirements gathering. It forces an explicit decision about scope: what is inside the system, and what is outside? Getting that boundary wrong — too wide, too narrow, or simply unclear — leads to missed requirements and scope creep. Showing the context diagram to stakeholders early creates a shared mental model before any detailed work begins.

The Three Elements of a Context Diagram

A context diagram contains exactly three types of element:

  1. The single process — represents the entire system. In Gane-Sarson notation it is drawn as a rounded rectangle (also called a "bubble"), numbered 0, and labelled with the system name. There is only one process at Level 0.
  2. External entities — people, organisations, or other systems that lie outside the boundary but exchange data with it. Drawn as plain rectangles (square boxes). Common examples: Customer, Supplier, Bank, Government Agency, or a third-party API.
  3. Data flows — labelled arrows showing the data moving between external entities and the process. The label names the data (e.g., "Booking Request", "Payment Confirmation"), not the activity. Each flow has a direction. Data stores do not appear at Level 0 — they are internal to the system.
Why no data stores at Level 0? Data stores (files, databases, tables) are internal to the system. The context diagram shows only what crosses the system boundary. Bringing internal storage into a Level 0 diagram would expose implementation detail before the scope has even been agreed.

Context Diagram: Clinic Booking System

Consider a Clinic Booking System being built for a small medical practice. The analyst has identified three external entities: Patient (books and cancels appointments, receives confirmations), Doctor (views the daily schedule, updates availability), and Health Authority (receives mandatory statistical reports). The context diagram captures all of this on one page:

Context diagram for the Clinic Booking System Patient (External Entity) Doctor (External Entity) Health Authority (External Entity) 0 Clinic Booking System Booking Request Confirmation / Reminder Availability Update Daily Schedule Statistical Report
DFD Level 0 (Context Diagram) — Clinic Booking System. The entire system is one rounded-rectangle process; external entities are plain rectangles; labelled arrows show data crossing the boundary.

How to Read This Diagram

Reading a context diagram is straightforward once you know the notation. Start at the central process and trace each arrow:

  • A Patient sends a Booking Request into the system. The system sends back a Confirmation / Reminder. This tells us the system must accept bookings from patients and notify them.
  • A Doctor sends an Availability Update (marking time as busy or open) and receives a Daily Schedule in return. The system must manage availability and produce schedules.
  • The Health Authority receives a Statistical Report from the system. The system must generate compliance reports — no data flows the other way, so the authority only consumes data.

Everything the system does can be traced back to one of these six data flows. If a stakeholder later asks for a feature that does not connect to any of these flows — or introduces a new external entity — the scope must be formally changed.

Step-by-Step: Drawing a Context Diagram

  1. Name the system clearly. The process label should be a noun phrase, not a verb (e.g., "Online Order System", not "Process Orders").
  2. Identify all external entities. Ask: who or what sends data to the system? Who or what receives data from the system? Check requirements documents and stakeholder lists.
  3. List the data flows for each entity. For each entity, list what data it sends in and what data it expects back. Name the data, not the action (e.g., "Invoice" not "Send Invoice").
  4. Draw and verify. Place the central process in the middle. Position entities around it. Draw and label arrows. Then review with stakeholders: does the boundary feel right? Is any entity missing? Is any flow unlabelled or misnamed?
Use the requirements document as your checklist. Every external entity mentioned in the requirements should appear in the context diagram. Every data flow mentioned should cross the boundary as a labelled arrow. If something appears in one but not the other, something is missing.

A Second Example: Online Order System

To reinforce the pattern, here is a context diagram for a simple Online Order System. External entities are: Customer (places orders, receives shipment updates), Supplier (receives purchase orders, sends stock confirmations), and Payment Gateway (authorises payments).

Context diagram for the Online Order System Customer (External Entity) Supplier (External Entity) Payment Gateway 0 Online Order System Order Shipment Update Purchase Order Stock Confirmation Payment Request Authorisation
DFD Level 0 — Online Order System. Three external entities, six labelled data flows, one central process labelled "0".

Common Mistakes to Avoid

  • Showing internal processes. Level 0 is one process only. Never split the central bubble into sub-processes — that is what Level 1 is for.
  • Unlabelled or vaguely labelled flows. "Data" or "Info" tells nobody anything. Label flows with the specific data item: "Invoice", "Password Reset Email", "Inventory Update".
  • Missing entities. Re-check your requirements list. If the system sends a monthly report to management, Management is an external entity — include it.
  • Connecting entities directly to each other. In a DFD, external entities never communicate directly with each other — all data flows pass through a process. Direct entity-to-entity arrows are a notation error.
  • Including data stores. Databases and files are internal; they do not appear at Level 0.
The context diagram is a communication tool first. It will be reviewed by non-technical stakeholders such as managers and clients. Keep notation clean, labels plain, and avoid technical jargon in flow names. A stakeholder who does not understand the diagram cannot validate it — and an unvalidated scope is a liability.

The Context Diagram as a Scoping Contract

Once stakeholders have reviewed and approved the context diagram, it acts as a lightweight scope agreement. Any requirement that cannot be traced to a data flow crossing the boundary is outside scope. Any new external entity discovered later triggers a formal scope-change discussion. This discipline is what separates well-managed projects from those that grow indefinitely through informal additions.

In the next lesson you will decompose the single Level 0 process into its constituent sub-processes, producing a DFD Level 1 that reveals the internal logic — and you will discover that the data flows into and out of Level 1 must exactly match those already defined in Level 0. That constraint, called balancing, is what keeps the model internally consistent.