This is one foundational lesson in the twelve-lesson course.

The question to explore

Do I need an umbrella?

How does one piece of information change the next step?

Try rain, no rain and an unknown forecast. A workflow uses the information it has to choose the next action. Missing information needs its own path.

Local teaching illustration / No AI model call / About 9 minutes / No account needed

Try the experiment

First step: Start with Unknown. Read why the decision waits.

1. Look for the forecast
2. Pause the umbrella decision
3. Check the missing forecast

The forecast is unknown. Check before deciding whether to take an umbrella.
1. Look for the forecastunknown
2. Pause the umbrella decisionunknown
3. Check the missing forecastcheck first
Unknown forecast → Pause & check before decidingactive
Rain expected → Pack umbrella
No rain expected → Travel light

Change a control to explore the example when JavaScript is enabled.

  1. Start with Unknown. Read why the decision waits.
  2. Choose Rain expected in Forecast. Follow the steps to Take an umbrella.
  3. Choose No rain expected, then Unknown. Explain why missing information should not quietly become no rain.

The idea

A branch is a choice between next steps. Here, expected rain means take an umbrella; no expected rain means leave it. An unknown forecast means check before deciding.

You choose the forecast and a written rule follows it. No weather service or AI model runs here. A missing forecast does not mean there will be no rain.

Worked example: run it yourself

Two versions of the umbrella rule. The careless one has two branches, so a missing forecast becomes “leave it at home”. The careful one has a third branch for anything it does not recognize.

Save it as umbrella.js and run node umbrella.js in a terminal (Node.js 18 or later), or paste it into your browser’s developer console. Download umbrella.js

function careless(forecast) {
  return forecast === 'rain' ? 'Take an umbrella' : 'Leave it at home';
}
function careful(forecast) {
  if (forecast === 'rain') return 'Take an umbrella';
  if (forecast === 'dry') return 'Leave it at home';
  return 'Forecast missing: check again before deciding';
}
for (const forecast of ['rain', 'dry', null]) {
  console.log(String(forecast).padEnd(4), '| careless:', careless(forecast), '| careful:', careful(forecast));
}

Output, as printed by Node.js 25.3.0 on 3 December 2026:

rain | careless: Take an umbrella | careful: Take an umbrella
dry  | careless: Leave it at home | careful: Leave it at home
null | careless: Leave it at home | careful: Forecast missing: check again before deciding

Try it

Predict what both functions return for undefined, and for 'Rain' with a capital R. Then run them.

Check your answer

careless() says Leave it at home for both. careful() says Forecast missing for both. A typo in the data is not a forecast of dry weather, so it belongs on the missing path too.

Take this with you

What changed?

A workflow connects information, a decision and the next action.

Try explaining it.

If a weather service fails, should the program treat that as a forecast of no rain?

Open a possible explanation

No. An unavailable forecast says nothing about whether rain is expected. Report the missing information and check again before choosing a branch.

Choose a next step

Continue the course in order, or open the course map.