System Design Atlas

Electricity grid flexibility dispatch

04 / 10Worked example

Change commands and retries

How do generation and validity windows prevent delayed control effects?

Scale alone does not ensure consistent retry behaviour. This proposed API binds the role, business object, change payload and expected state to each new intent. An idempotency key identifies the same intent after a response is lost.

Starting point Multiply 20 kW by 0.25 h to obtain 5 kWh.

Assumptions for the example case

A fictional design with controllable equipment and an agreed power range; 15-minute dispatch; UTC time windows; local safety limits and measured effects. Figures and quality targets are illustrative test assumptions. Protection systems, primary frequency control, market bids and evidence of specific energy-regulation compliance remain outside its scope.

Retries and new intent

Control contract · identity, generation, kW and expiry

C-81Generation 8 · 20 kW · 12:15
C-81 → Lokale PrüfungIdentity + Generation
Local validationLimits + time windows
Identical → same confirmation25 kW → conflictGeneration 7 → no effect

An identical C-81 confirms the same acceptance; a changed setpoint conflicts and generation 7 has no effect.

A delayed command reaches the equipment. Check generation and expiry locally. Old or expired commands must not take effect later.

Proposed domain API contracts

  1. POST/flexibility-calls

    Reserve agreed power capacity.

    Input
    Grid operations, A-81, 20 kW, interval [12:00,12:15) UTC, rationale, expected availability and key.
    Result
    F-81 with atomic power limitation; overbooking or unusable current measurement is rejected.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  2. POST/plant-commands

    Transmit a time-limited control command.

    Input
    Authenticated adapter, C-81, F-81, A-81, generation 8, power 20 kW, start, exclusive end and authorisation evidence.
    Result
    Local acceptance or rejection by generation, time and asset limits; receipt does not yet confirm any effect.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  3. POST/measurements

    Accept observed power measurements.

    Input
    Measurement source, M-81, A-81, measurement time, reception time, kW value, quality and event key.
    Result
    Durable observation; age over 30 s prevents new dispatch based on this value. Effect assessment remains separate.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  4. GET/plant-commands/{id}

    Reconcile an existing command.

    Input
    Authorised equipment adapter, C-81 and generation.
    Result
    Documented local acceptance/expiration status; measured effect is reported separately.
    Retry behaviour
    Repeating a read creates no business effect; the returned current state may change between requests.

Time-limit commands

Time-limit commands

Check the generation and expiry locally.

A delayed order reaches the plant.

Old or expired orders do not have a retroactive effect.

Alternative considered
Relying only on arrival order may favour an old command.
Trade-off
Clocks and generations need a verified contract.
Reassess
Time deviations exceed the agreed tolerance.

Terms in this step

Time-limit commands
Old or expired orders do not have a retroactive effect.

Try it yourself

Generation 7 arrives after generation 8. Generation 8 is then repeated with a changed setpoint value. Predict both answers.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
Generation 7 remains ineffective as obsolete.
Second part of the solution
Generation 8 with changed content causes a conflict. A changed dispatch requires a new command that explicitly replaces the old one.

Apply to your project

Which corresponding assumption would you check first in your project when clock deviations exceed the agreed tolerance?

Step 5 examines: reserve flexibility.