Runtime flow shows the order of operations

A static map answers “what is in the project.” Runtime flow answers “what happens in a specific scenario.” You need to reconstruct the order of calls, data movement, side effects, errors, and the configuration that changes the execution path.

The entry point is not necessarily `main()`: it can be an HTTP route, a UI action, a CLI command, a background task, or startup logic.

Flow layerWhat to record
Entry pointRoute, component, job, or command
Call chainFiles, classes, and methods in the actual order
DataHow a request becomes a model, record, and response
Side effectsDatabase, reservation, external APIs, events, and notifications
ErrorsWhere execution stops and what has already happened
ConfigurationProfiles, feature flags, and environment variables that affect the flow

Investigate one story at a time

  1. Choose a specific scenario, such as placing an order.
  2. Find the UI or API entry point.
  3. Build a call chain with references to the code.
  4. Describe data transformations at each step.
  5. Find the successful and failed paths.
  6. Check related tests and configuration.
  7. Record unverified areas in the inventory.
Example flow form
POST /api/orders
  → controller
  → order service
  → reserve inventory
  → authorize payment
  → save order
  → publish event
  → notification or background job

The happy path is not enough

  • the item may be unavailable before the order is saved;
  • the payment may be declined after earlier steps;
  • an external service may time out;
  • an event may start a separate background process;
  • a partial side effect may remain before the error.

A prompt for flow analysis in Claude

Trace one scenario: placing an order.
Do not edit files.
Find the entry point and call chain.
For each step, show data movement,
side effects, configuration, error paths, and tests.
Mark unverified assumptions separately.

Flow must be confirmed, not guessed

Verify at least the entry point, the central service, and the error test. Do not equate folder order with runtime order, and do not mix flow reconstruction with refactoring proposals.

Canonical lesson source · JavaRush

Open JavaRush material