Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
f97c2f0
feat: add Automation data model
Flix6x Jul 11, 2026
f410437
feat: CLI commands to manage and run automations
Flix6x Jul 11, 2026
6f6591c
feat: record on forecasting jobs how they were created
Flix6x Jul 11, 2026
fb74bfc
feat: API endpoints to list an asset's automations
Flix6x Jul 11, 2026
ab62b9f
feat: UI page listing an asset's automations
Flix6x Jul 11, 2026
db8f288
test: cover automations CLI, API and UI
Flix6x Jul 11, 2026
9cb4f63
docs: document automations
Flix6x Jul 11, 2026
e0575c7
docs: changelog entry for automations
Flix6x Jul 11, 2026
b1f56bf
fix: render cron descriptions in 24-hour format regardless of locale
Flix6x Jul 11, 2026
de6fb71
fix: address code review findings for automations
Flix6x Jul 11, 2026
bf2cc60
fix: address code review findings for automations (remaining files)
Flix6x Jul 11, 2026
0b345b2
feat: record on scheduling jobs how they were created
Flix6x Jul 11, 2026
4c0c5db
feat: schedules as automations
Flix6x Jul 11, 2026
ac4c74a
docs: changelog entry for schedule automations
Flix6x Jul 11, 2026
f6e1e10
feat: CRUD for automations via API and UI
Flix6x Jul 11, 2026
073abd9
docs: changelog entry for automations CRUD
Flix6x Jul 11, 2026
6184940
feat: reports can run as background jobs
Flix6x Jul 11, 2026
79e1609
feat: reports as automations
Flix6x Jul 11, 2026
5eac468
docs: changelog entry for reports as jobs and automations
Flix6x Jul 11, 2026
791fcf4
feat: anchor default report windows to the automation's actual last run
Flix6x Jul 11, 2026
0dca8fc
docs: add an Automations concept page
Flix6x Jul 11, 2026
176d800
fix: address stack code review findings
Flix6x Jul 11, 2026
7493c13
test: assert on the cron validation failure without pinning click's m…
Flix6x Jul 12, 2026
7bc3056
merge: synchronize automations with current main
BelhsanHmida Jul 31, 2026
15c9937
data/schemas: restrict automations to five-field cron
BelhsanHmida Jul 31, 2026
3090cf5
data/schemas/tests: cover automation cron field count
BelhsanHmida Jul 31, 2026
8cc3920
cli/jobs: retain automation guard after queueing failure
BelhsanHmida Jul 31, 2026
29c46b3
cli/tests: cover partial automation queue failure
BelhsanHmida Jul 31, 2026
8666c31
cli: normalize YAML forecasting option files
BelhsanHmida Jul 31, 2026
3433020
cli/tests: cover automation YAML option files
BelhsanHmida Jul 31, 2026
430dcef
data/services: redact inaccessible automation provenance
BelhsanHmida Jul 31, 2026
6c4bbc6
api/v3_0/tests: cover automation provenance authorization
BelhsanHmida Jul 31, 2026
337ad3b
ui/assets: distinguish automation load failures
BelhsanHmida Jul 31, 2026
119fc9d
ui/tests: cover automation load error state
BelhsanHmida Jul 31, 2026
04daae4
utils/docs: preserve standalone asterisks in RST conversion
BelhsanHmida Jul 31, 2026
22addda
utils/tests: cover RST cron wildcard conversion
BelhsanHmida Jul 31, 2026
edf77a5
docs/forecasting: clarify automation execution contract
BelhsanHmida Jul 31, 2026
a6cee99
changelog: record automation API and runner contract
BelhsanHmida Jul 31, 2026
194f8cc
api/docs: show job creation provenance
BelhsanHmida Jul 31, 2026
a3d7ebe
test: keep forecast CLI stub compatible with job provenance
BelhsanHmida Jul 31, 2026
de76798
Merge main into forecast automations
BelhsanHmida Aug 4, 2026
646f9fd
fix: require valid automation generators
BelhsanHmida Aug 4, 2026
4664afe
test: cover automation generator retention
BelhsanHmida Aug 4, 2026
b801d74
fix: constrain forecast automation outputs
BelhsanHmida Aug 5, 2026
006f85c
test: cover forecast automation output scope
BelhsanHmida Aug 5, 2026
dba4edc
docs: explain forecast automation ownership rules
BelhsanHmida Aug 5, 2026
efdda5a
fix: merge automation and main migration heads
BelhsanHmida Aug 5, 2026
5e86232
merge: synchronize schedule automations with reviewed parent
BelhsanHmida Aug 5, 2026
bc1fc32
data/models: allow schedule automations without generators
BelhsanHmida Aug 5, 2026
2f4afe2
cli/tests: cover schedule automation validation
BelhsanHmida Aug 5, 2026
d3c3082
data/tests: cover schedule automation dispatch
BelhsanHmida Aug 5, 2026
9505e2b
api/v3_0/tests: cover schedule job provenance
BelhsanHmida Aug 5, 2026
5de1f20
ui/tests: cover automation type tabs
BelhsanHmida Aug 5, 2026
6bf6143
scheduling: harden automation dispatch
BelhsanHmida Aug 5, 2026
03f1b88
cli: reject forecast options for schedule automations
BelhsanHmida Aug 5, 2026
75b2be6
ui/assets: resize automation tables on tab changes
BelhsanHmida Aug 5, 2026
71a7196
docs: clarify schedule automation inputs
BelhsanHmida Aug 5, 2026
d39f60f
cli/tests: cover malformed automation YAML
BelhsanHmida Aug 5, 2026
5b04664
cli: report malformed automation YAML
BelhsanHmida Aug 5, 2026
1ec9324
data/tests: cover stored schedule flex configuration
BelhsanHmida Aug 5, 2026
90025d3
scheduling: load stored flex config for minimal triggers
BelhsanHmida Aug 5, 2026
2f0b09c
docs/scheduling: describe trigger propagation
BelhsanHmida Aug 5, 2026
c783e8f
data/models: let data generators report their input and output sensors
Flix6x Aug 5, 2026
8b2cc73
data/models/forecasting: only announce a pipeline run when actually r…
Flix6x Aug 5, 2026
b37256f
cli: default the automation recurrence to daily, and reject options t…
Flix6x Aug 5, 2026
aa64afb
api/v3_0: report an automation's input and output sensors
Flix6x Aug 5, 2026
b438e8f
api/v3_0: add an endpoint for one data source
Flix6x Aug 5, 2026
17f432b
api/v3_0: regenerate the OpenAPI specs
Flix6x Aug 5, 2026
1ea8f78
ui: link an automation's details to its sensors, and make the listing…
Flix6x Aug 5, 2026
2b87d5e
ui: show a sensor's data source record and the automations feeding it
Flix6x Aug 5, 2026
1869247
tests: cover the automation and data source review follow-ups
Flix6x Aug 5, 2026
03626b4
docs: describe the automation and data source follow-ups
Flix6x Aug 5, 2026
0f8fe58
Merge the current automations branch into the review follow-ups
Flix6x Aug 5, 2026
1dccf9f
api/v3_0: regenerate the OpenAPI specs after merging
Flix6x Aug 5, 2026
9f1d075
cli: only reject configuration options that were actually given with …
Flix6x Aug 5, 2026
b397907
data/services: only consider automations that could feed a sensor
Flix6x Aug 5, 2026
318cd91
tests: follow the merged automation behaviour
Flix6x Aug 5, 2026
2237245
data/services: only let a user automate sensors they can access thems…
Flix6x Aug 5, 2026
4765fd8
api/v3_0: regenerate the OpenAPI specs
Flix6x Aug 5, 2026
5d92ea0
api/v3_0/tests: cover automating an inaccessible sensor
Flix6x Aug 5, 2026
d4bf80e
docs: describe which sensors an automation may involve
Flix6x Aug 5, 2026
d8701c6
data/services: check every sensor a schedule would be recorded on
Flix6x Aug 5, 2026
05e00ac
api/v3_0/tests: cover a schedule aggregated onto an inaccessible sensor
Flix6x Aug 5, 2026
1eb3a50
cli: keep mypy happy about click 8 attributes
BelhsanHmida Aug 7, 2026
9653e10
cli: keep the automation help focused on the automation
BelhsanHmida Aug 7, 2026
87e07f6
data/models: count a source-filtered regressor as an input sensor
BelhsanHmida Aug 7, 2026
8860bd0
data/services: do not report no sensors when an automation's sensors …
BelhsanHmida Aug 10, 2026
2b961cc
Feat automation timezones catchup (#2396)
BelhsanHmida Aug 10, 2026
f75bb6d
Merge branch 'main' into feat/2288-automations-for-forecasts
BelhsanHmida Aug 10, 2026
1e53696
Merge the forecast automation base into the schedule automations
BelhsanHmida Aug 10, 2026
db0a57b
Merge the schedule automations into the automations CRUD
BelhsanHmida Aug 10, 2026
1f68beb
data/migrations: rejoin the two automation migration branches
BelhsanHmida Aug 11, 2026
f625330
Merge branch 'work/2293-sync' into work/2294-sync
BelhsanHmida Aug 11, 2026
64ad898
data/services: let the forecaster say which sensors an automation inv…
BelhsanHmida Aug 11, 2026
7a3c38a
api/v3_0: let an automation's timezone be set and changed through the…
BelhsanHmida Aug 11, 2026
5612387
data/services: set up the forecaster's data source only once the auto…
BelhsanHmida Aug 11, 2026
a98b4fc
Merge origin/main into automation fixes
BelhsanHmida Aug 11, 2026
8eac59f
fix(data/schemas): reject cron expressions without dates
BelhsanHmida Aug 11, 2026
249642f
fix(data/services): isolate invalid recurrences and stale claims
BelhsanHmida Aug 11, 2026
bf23428
fix(api/v3_0): protect automation sensor details
BelhsanHmida Aug 11, 2026
af5957b
test(cli): cover impossible recurrence input
BelhsanHmida Aug 11, 2026
c18f7de
test(data/services): cover resilient automation claims
BelhsanHmida Aug 11, 2026
23ea45a
test(api/v3_0): cover private automation dependencies
BelhsanHmida Aug 11, 2026
a7671de
Merge reviewed forecast automation fixes
BelhsanHmida Aug 11, 2026
5af2170
fix(data/services): resolve schedule automation sensors
BelhsanHmida Aug 11, 2026
32c4970
test(data/services): cover schedule sensor resolution
BelhsanHmida Aug 11, 2026
a0a1944
test(api/v3_0): expose schedule dependency details
BelhsanHmida Aug 11, 2026
87f670b
Merge reviewed schedule automation fixes
BelhsanHmida Aug 11, 2026
1c7b3d3
fix(data/services): hide inaccessible sensor names
BelhsanHmida Aug 11, 2026
b7979b5
test(api/v3_0): isolate automation endpoint tests
BelhsanHmida Aug 11, 2026
10b9155
feat(ui/views): provide automation timezones
BelhsanHmida Aug 11, 2026
a39c4ed
feat(ui): edit automation recurrence timezones
BelhsanHmida Aug 11, 2026
69fd5bf
test(ui): cover automation timezone controls
BelhsanHmida Aug 11, 2026
aa469bc
docs(changelog): mention automation timezones
BelhsanHmida Aug 11, 2026
9b5af64
fix(data/services): preserve schedule validation errors
BelhsanHmida Aug 11, 2026
881c9bd
feat(automations): integrate reports with the CRUD stack
BelhsanHmida Aug 12, 2026
292a0fa
fix(automations): authorize reporter sensor dependencies
BelhsanHmida Aug 12, 2026
8b76815
fix(reporting): require report inputs and outputs
BelhsanHmida Aug 12, 2026
82cb3bb
fix(automations): constrain report output scope
BelhsanHmida Aug 12, 2026
3e6c2ec
fix(automations): require generators for reports
BelhsanHmida Aug 12, 2026
601f951
fix(automations): anchor reports to claimed occurrences
BelhsanHmida Aug 12, 2026
f0c3fce
fix(automations): advance report coverage monotonically
BelhsanHmida Aug 12, 2026
2350b68
test(ui): cover report automation listings
BelhsanHmida Aug 12, 2026
77c6c2d
docs(automations): document report occurrence semantics
BelhsanHmida Aug 12, 2026
95b6187
test(api): close rejected report transactions
BelhsanHmida Aug 12, 2026
63fee6b
Merge branch 'main' into feat/2288-automations-for-forecasts
BelhsanHmida Aug 12, 2026
b8d76a9
cli: refuse forecaster options that were given, not merely ones that …
BelhsanHmida Aug 12, 2026
dd5fae6
data/models: name an automation's cursor after what it points at
Flix6x Aug 31, 2026
b3845d8
tests: follow the automation cursor rename
Flix6x Aug 31, 2026
dbf0bae
docs: explain the automation cursor, and say "run" instead of "occurr…
Flix6x Aug 31, 2026
7e1bab2
docs/changelog: give the automation API changes their own version sec…
Flix6x Aug 31, 2026
d1cd0a2
docs/changelog: restore the v3.0-32 underline to full length
Flix6x Aug 31, 2026
6474eec
data/services: address review findings on the automations service
Flix6x Sep 1, 2026
1bda4b5
data/models: index the automation asset foreign key
Flix6x Sep 1, 2026
8d8514d
api/v3_0: work out an automation's sensors once when they cannot be r…
Flix6x Sep 1, 2026
eca2520
cli: warn which automations a sensor deletion would break
Flix6x Sep 1, 2026
fc91bc4
tests: cover the sensor deletion warning, and stop depending on caplog
Flix6x Sep 1, 2026
05e059e
docs/changelog: record the sensor deletion warning
Flix6x Sep 1, 2026
6541676
Merge branch 'main' into feat/2288-automations-for-forecasts
Flix6x Sep 1, 2026
4051dc2
docs: give automations their own page
Flix6x Sep 1, 2026
208e5be
Merge branch 'feat/2288-automations-for-forecasts' into feat/2288-sch…
Flix6x Sep 1, 2026
4be5574
Merge branch 'feat/2288-schedule-automations' into feat/2288-automati…
Flix6x Sep 1, 2026
2e6fe75
Merge branch 'feat/2288-automations-crud' into feat/2288-report-autom…
Flix6x Sep 1, 2026
06bf14b
data/migrations: index the automation asset FK without adding a revision
Flix6x Sep 1, 2026
170a38e
Merge remote-tracking branch 'origin/feat/2288-automations-for-foreca…
Flix6x Sep 1, 2026
4080c44
Merge remote-tracking branch 'origin/feat/2288-schedule-automations' …
Flix6x Sep 1, 2026
b8b8db5
Merge remote-tracking branch 'origin/feat/2288-automations-crud' into…
Flix6x Sep 1, 2026
7b83dfa
Merge branch 'main' into feat/2288-schedule-automations
Flix6x Sep 1, 2026
e8f5bc1
Merge remote-tracking branch 'origin/feat/2288-schedule-automations' …
Flix6x Sep 1, 2026
2701717
Merge remote-tracking branch 'origin/feat/2288-automations-crud' into…
Flix6x Sep 1, 2026
133a6e4
Merge branch 'main' into feat/2288-schedule-automations
Flix6x Sep 2, 2026
0132c63
docs: document schedule automations in the automations chapter
Flix6x Sep 2, 2026
940f22e
Name automation types after the task, like the rest of the codebase
Flix6x Sep 2, 2026
12903db
docs/changelog: move the data source inspection entry to v1.1.0
Flix6x Sep 2, 2026
4f55191
Schedulers as data generators, and a generator on every automation (#…
Flix6x Sep 7, 2026
c50b9cf
Merge branch 'main' into feat/2288-schedule-automations
Flix6x Sep 8, 2026
952bfa9
Name automation types after the task, not its results
BelhsanHmida Sep 8, 2026
9c1312f
Merge branch 'feat/2288-schedule-automations' into feat/2288-automati…
BelhsanHmida Sep 8, 2026
0b59c15
Gate managing an automation the way running one is gated
BelhsanHmida Sep 8, 2026
89c1482
Record this branch's endpoints in the changelogs
BelhsanHmida Sep 8, 2026
37c55ff
Give the trigger tests the fixtures this file now uses
BelhsanHmida Sep 8, 2026
b171ac6
Merge branch 'feat/2288-automations-crud' into feat/2288-report-autom…
BelhsanHmida Sep 8, 2026
2ad2e45
Merge origin/main into the automations CRUD branch
BelhsanHmida Sep 11, 2026
51fb4fb
Close the handlers the Run now button was pasted into
BelhsanHmida Sep 11, 2026
67a7e2b
Merge branch 'feat/2288-automations-crud' into feat/2288-report-autom…
BelhsanHmida Sep 11, 2026
5fa7818
Merge origin/main into automations CRUD
BelhsanHmida Sep 14, 2026
d7140c3
docker: dispatch due automations in Compose
BelhsanHmida Sep 14, 2026
cfe71b3
docs: explain Compose automation dispatcher
BelhsanHmida Sep 14, 2026
c52d61e
automations: show the next run in local time
BelhsanHmida Sep 14, 2026
7051b62
tests: cover next automation runs across DST
BelhsanHmida Sep 14, 2026
957094b
docs: explain upcoming automation run times
BelhsanHmida Sep 14, 2026
78e6bf7
ui/automations: align the row actions
BelhsanHmida Sep 14, 2026
430e3f2
tests: verify automation action layout in a browser
BelhsanHmida Sep 14, 2026
f3a1846
ui/automations: line the row actions up across rows
BelhsanHmida Sep 14, 2026
ea2a7d5
docs: rewrap a next-run docstring on a punctuation break
BelhsanHmida Sep 14, 2026
0cadbfe
changelog: record the automation schedule and action UX
BelhsanHmida Sep 14, 2026
ffc3611
ui/automations: collect the row actions into one menu
BelhsanHmida Sep 14, 2026
39ea328
changelog: describe the automation actions menu
BelhsanHmida Sep 14, 2026
fbe1162
Merge branch 'main' into feat/2288-automations-crud
BelhsanHmida Sep 14, 2026
789ceca
Address review: schema decorators, asset timezone, naming and wording
Flix6x Sep 15, 2026
396f2ef
ui/automations: reflow the two stylesheet comments
Flix6x Sep 15, 2026
b4d0b3e
Address Copilot round 2: API docs that no longer matched the code
Flix6x Sep 15, 2026
7f0511a
Address Copilot round 3: report unknown sensors instead of failing
Flix6x Sep 15, 2026
223563e
Address Copilot round 4: say what resetting the cursor actually does
Flix6x Sep 15, 2026
91081fc
Address Copilot round 5: reflow two docstrings, and cover the delete …
Flix6x Sep 15, 2026
458a9eb
Address Copilot round 6: drop the duplicated scheduler data source wa…
Flix6x Sep 15, 2026
142ccff
Pin the automation creation schema's timezone contract in a test
Flix6x Sep 15, 2026
4cb27c3
Report an automation's times in its own timezone, and restructure its…
Flix6x Sep 15, 2026
4e723c1
docs: drop a duplicated v1.0.0 entry, and stop calling the cursor a U…
Flix6x Sep 15, 2026
697f58f
Address review: hand the create endpoint its whole request, and drop …
Flix6x Sep 15, 2026
8a7b8db
Name the automation API's fields in kebab-case
Flix6x Sep 15, 2026
d591d4f
Name the generator class after what it is, not after one of its kinds
Flix6x Sep 15, 2026
4128990
Name the data generator class and the source it resolves to apart
Flix6x Sep 15, 2026
1e72b6d
Merge the squash-merged automations CRUD, and main, into the report a…
Flix6x Sep 15, 2026
27c181f
Merge branch 'main' into feat/2288-report-automations
Flix6x Sep 15, 2026
d75c91f
Merge origin/main into feat/2288-report-automations
Flix6x Sep 16, 2026
4514e17
Take back what the restack onto main quietly undid
Flix6x Sep 16, 2026
fe1a391
Resolve a report automation's offsets in the automation's timezone
Flix6x Sep 16, 2026
388abcb
Refuse a report automation that fixes its report's period
Flix6x Sep 16, 2026
f119b56
Record report coverage only for report automations
Flix6x Sep 16, 2026
8208023
Hold an automation's report to the sensors it was checked against
Flix6x Sep 16, 2026
62a9f07
Rebuild the report automation docs on main's, and file the entries un…
Flix6x Sep 16, 2026
2dbac57
Break this branch's comments and docstrings only after punctuation
Flix6x Sep 16, 2026
1a689c5
Keep a job's trigger part of its identity in the job cache, as on main
Flix6x Sep 16, 2026
83b149e
Label the Reports tab like the others, and word the timezone hint for…
Flix6x Sep 16, 2026
b935f4f
Learn whether a report job is an automation's from its trigger alone
Flix6x Sep 16, 2026
9628b73
Call the automation's timezone its recurrence timezone
Flix6x Sep 16, 2026
7714775
Refuse a schedule automation that fixes its schedule's start
Flix6x Sep 16, 2026
79814b3
Refuse a fixed belief time in schedule and report automations
Flix6x Sep 16, 2026
64936ff
Move refusing fixed moments in schedule automations out to #2550
Flix6x Sep 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ v1.1.0 | September XX, 2026
New features
-------------

* Automations: recurring tasks defined per asset, which compute forecasts or schedules on a cron recurrence read in the automation's own timezone, defined from the CLI, the API or the UI, and dispatched once a minute by ``flexmeasures jobs run-automations``. See :ref:`automations` for what they do, and `Automations, in detail`_ for what each pull request contributed.
* Automations: recurring tasks defined per asset, which compute forecasts, schedules or reports on a cron recurrence read in the automation's own timezone, defined from the CLI, the API or the UI, and dispatched once a minute by ``flexmeasures jobs run-automations``. See :ref:`automations` for what they do, and `Automations, in detail`_ for what each pull request contributed.
* In the UI, the full record of the data source selected on a sensor page can be inspected, backed by a new API endpoint (``[GET] /sources/(id)``) [see `PR #2290 <https://www.github.com/FlexMeasures/flexmeasures/pull/2290>`_]
* Try out a forecast without recording it, using ``flexmeasures add forecasts --dry-run``, which computes the forecast in full and reports the sensor, data source, number of beliefs and event range it would have saved [see `PR #2483 <https://www.github.com/FlexMeasures/flexmeasures/pull/2483>`_]
* Run one-off reports as background jobs from the CLI or the asset API, with sensor-level authorization and a dedicated reporting worker queue [see `PR #2298 <https://github.com/FlexMeasures/flexmeasures/pull/2298>`_]
Expand Down Expand Up @@ -67,6 +67,7 @@ Automations arrived over several pull requests. This is what each of them contri
* A single automation can now be run on demand, from the CLI (``flexmeasures jobs run-automation``), the API (``POST /assets/<id>/automations/<automation_id>/trigger``) and the asset's *Automations* page (a *Run now* button), which is useful to try out a new automation, to re-run one after fixing what made it fail, or to refresh its results after late input data arrived [see `PR #2460 <https://www.github.com/FlexMeasures/flexmeasures/pull/2460>`_]
* Automations can be created, edited and deleted in the UI and through new API endpoints (``[POST|PATCH|DELETE] /assets/(id)/automations``), by whoever may add data under the asset, with their recurrence expressed in a selectable IANA timezone, and only involving sensors they can access themselves (read access to the sensors an automation reads, and permission to record data on the sensors it writes to). The *Automations* page shows when each active automation is due to run next, as a clock time in the automation's own timezone, so a recurrence no longer has to be read back from its cron string; the same time is available as ``next_run`` on the automations API endpoints, and is null while an automation is inactive. It is the next scheduled clock time, so it excludes catch-up work still pending, and it follows the dispatcher's daylight-saving rules, taking the first fold of a repeated local time and the first valid minute after a skipped one. Each row's *Run now*, *Edit*, *Activate*/*Deactivate* and *Delete* controls are collected into a single *Actions* menu, leaving *Details* beside it, so a long listing carries two controls per row instead of five [see `PR #2294 <https://www.github.com/FlexMeasures/flexmeasures/pull/2294>`_]
* An automation's output sensors are checked against its creator's permissions when the automation is created, and the schedules it computes are held to exactly those sensors: a scheduler that returns results for any other sensor is refused, rather than recording on a sensor that was only ever checked for read access [see `PR #2536 <https://www.github.com/FlexMeasures/flexmeasures/pull/2536>`_]
* Reports as well as forecasts and schedules: a report automation stores report parameters, with its reporter and the reporter's configuration on a data source, and reports on a period resolved afresh on each run, either from ``start-offset`` and ``end-offset`` applied to the run time in the automation's timezone, or since the last successful report ended, while a fixed ``start`` or ``end`` is refused; a report job records only on the sensors the automation was checked against [see `PR #2297 <https://www.github.com/FlexMeasures/flexmeasures/pull/2297>`_]


v1.0.1 | September 9, 2026
Expand Down
11 changes: 6 additions & 5 deletions documentation/cli/change_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ since v1.1.0 | September XX, 2026
* Fix ``flexmeasures add schedule --dry-run`` saving a schedule when combined with ``--as-job``: the combination is now rejected, and a dry run reports the beliefs and events it would have saved.
* Add ``flexmeasures add forecasts --dry-run`` to compute a forecast and see what it would record, without saving anything to the database. It cannot be combined with ``--as-job``.
* Add ``flexmeasures add report --as-job`` and the ``reporting`` worker queue for asynchronous one-off reports.
* Add ``flexmeasures add automation``, ``flexmeasures edit automation`` and ``flexmeasures delete automation`` to manage automations (recurring tasks on an asset, with ``--type forecasting``, ``--type scheduling`` or ``--type reporting`` saying which task to automate). Each automation carries its own IANA timezone (``--timezone``), in which its cron expression is interpreted.
* ``flexmeasures add automation --type scheduling`` refuses a flex config field which fixes a moment in time, such as ``soc-at-start`` or a ``soc-targets`` entry with a ``datetime``, naming the field: a recurring schedule automation computes a fresh schedule on every run, so such a value would be stale on the next one.
* ``flexmeasures add automation --type reporting`` refuses a fixed ``start`` or ``end`` in the report parameters, as every run would then report on the same period, and points to ``start-offset`` and ``end-offset`` instead.
* Add ``flexmeasures jobs run-automations`` to queue jobs for all automations that are due to run this minute from standard five-field cron expressions. Run this command once per minute. It makes at most one queueing attempt per automation per minute, including when an attempt fails after partially queueing jobs. Runs missed while the runner was down are caught up once, with several missed forecast runs coalesced into the latest useful forecast, and a run at a skipped or repeated daylight-saving-time hour happens exactly once.
* Add ``flexmeasures jobs run-automation --automation <id>`` to queue the jobs for a single run of one automation, now, on top of its recurring runs. This leaves the automation's cursor alone, so its next recurring run still happens as scheduled, and inactive automations can be run this way, too.
* ``flexmeasures delete sensor`` now warns which automations read from or write to a sensor before it is deleted, as an automation refers to its sensors by ID and would fail on its next run.

since v1.0.1 | September 9, 2026
=================================
Expand All @@ -24,11 +30,6 @@ since v1.0.0 | August 11, 2026
* Add ``flexmeasures add plan``, ``flexmeasures show plans`` and ``flexmeasures edit plan``, to manage the rate limits and quotas which apply to the accounts on a plan.
* Add ``flexmeasures edit secret`` to store an encrypted secret on an account or asset.
* Add ``flexmeasures delete secret`` to remove an encrypted secret from an account or asset.
* Add ``flexmeasures add automation``, ``flexmeasures edit automation`` and ``flexmeasures delete automation`` to manage automations (recurring tasks on an asset, with ``--type forecasting`` or ``--type scheduling`` saying which task to automate). Each automation carries its own IANA timezone (``--timezone``), in which its cron expression is interpreted.
* ``flexmeasures add automation --type scheduling`` refuses a flex config field which fixes a moment in time, such as ``soc-at-start`` or a ``soc-targets`` entry with a ``datetime``, naming the field: a recurring schedule automation computes a fresh schedule on every run, so such a value would be stale on the next one.
* Add ``flexmeasures jobs run-automations`` to queue jobs for all automations that are due to run this minute from standard five-field cron expressions. Run this command once per minute. It makes at most one queueing attempt per automation per minute, including when an attempt fails after partially queueing jobs. Runs missed while the runner was down are caught up once, with several missed forecast runs coalesced into the latest useful forecast, and a run at a skipped or repeated daylight-saving-time hour happens exactly once.
* Add ``flexmeasures jobs run-automation --automation <id>`` to queue the jobs for a single run of one automation, now, on top of its recurring runs. This leaves the automation's cursor alone, so its next recurring run still happens as scheduled, and inactive automations can be run this way, too.
* ``flexmeasures delete sensor`` now warns which automations read from or write to a sensor before it is deleted, as an automation refers to its sensors by ID and would fail on its next run.
* ``flexmeasures show data-sources`` now shows the account a data source belongs to, and lists the sensors holding data recorded by a single source with ``--show-sensors``.

since v0.33.0 | June 01, 2026
Expand Down
2 changes: 1 addition & 1 deletion documentation/cli/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ of which some are referred to in this documentation.
``flexmeasures add annotation`` Add annotation to accounts, assets and/or sensors.
``flexmeasures add toy-account`` Create a toy account, for tutorials and trying things.
``flexmeasures add report`` Create a report.
``flexmeasures add automation`` Add an automation: a recurring task (computing forecasts or schedules) on an asset, with its own cron timezone.
``flexmeasures add automation`` Add an automation: a recurring task (computing forecasts, schedules or reports) on an asset, with its own cron timezone.
================================================= =======================================


Expand Down
41 changes: 37 additions & 4 deletions documentation/features/automations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Automations
============

An **automation** is a recurring task defined on an asset.
For now, an automation computes forecasts or schedules; automating reports is planned.
An automation computes forecasts, schedules or reports.

On each run, the automation queues jobs (so make sure a worker is processing the ``forecasting`` or ``scheduling`` queue, whichever the automation needs, see :ref:`redis-queue`).
On each run, the automation queues jobs (so make sure a worker is processing the ``forecasting``, ``scheduling`` or ``reporting`` queue, whichever the automation needs, see :ref:`redis-queue`).
The parameters of the task were stored when the automation was created, and validated with the same schema that the CLI and API use.
Timing parameters are resolved on each run — for instance, the forecast or schedule start defaults to the time the automation runs, so each run produces fresh results.

Expand All @@ -20,7 +20,7 @@ Here is how you create an automation in the CLI, asking for daily (at 6 AM) fore
flexmeasures add automation --asset 3 --name "Daily PV forecasts" --type forecasting \
--cron "0 6 * * *" --timezone Europe/Amsterdam --sensor 12

``--type`` says which task to automate (``forecasting`` or ``scheduling``, matching the queue the jobs go to), and defaults to ``forecasting``.
``--type`` says which task to automate (``forecasting``, ``scheduling`` or ``reporting``, matching the queue the jobs go to), and defaults to ``forecasting``.
The remaining options are the ones the task itself needs: a forecast automation accepts everything `flexmeasures add forecast` accepts, such as ``--forecaster`` to pick the forecaster and ``--config`` to configure it (see :ref:`forecasting`).
The forecaster and its configuration are stored on a data source, so you can also pass ``--source`` to reuse the data source of an existing forecaster, in which case ``--forecaster`` and ``--config`` (and the individual configuration options) are not needed — the data source already determines them.
That data source is required while the automation exists, so it cannot be deleted until the automation is removed.
Expand Down Expand Up @@ -68,6 +68,39 @@ For example, this automation queues a scheduling job every hour, each time sched
echo 'duration: "PT12H"' > trigger-message.yml
flexmeasures add automation --asset 3 --name "Hourly schedules" --cron "0 * * * *" --type scheduling --parameters trigger-message.yml

Automating reports
------------------

A report automation's parameters are report parameters, as ``flexmeasures add report`` accepts them (see :ref:`reporting`), passed in a file through ``--parameters``.
Name the reporter with ``--reporter``, and configure it with ``--config``.
As for a forecast automation, the reporter and its configuration are stored on a data source, so ``--source`` can reuse the data source of an existing reporter instead.

The sensors a report is recorded on must belong to the automation's asset or one of its descendants.
This is checked when the automation is created and immediately before each run.
A report job only records on those sensors, so a reporter that returns results for any other sensor is refused.

Because the report is computed afresh on every run, its parameters cannot fix the period it covers: an absolute ``start`` or ``end`` is refused when the automation is created.
Say instead how the period relates to the run, in one of two ways:

- Give ``start-offset`` and ``end-offset``, as comma-separated Pandas offsets plus ``DB`` (day begin) and ``HB`` (hour begin), applied to the run time on the automation's own clock, the one its cron string is read in.
For instance, ``start-offset: "-1D,DB"`` with ``end-offset: "DB"`` reports on the whole of the previous day.
Leave out ``end-offset`` to report up to the run time.
- Leave the timing out to report on the period since the last successful report ended, falling back to the previous cron period on the first run.
That end is recorded by the reporting job itself, once it has succeeded, so a failed report leaves no gap: the next run starts where the last successful one ended.

The two differ after the runner was down.
It catches up with only the latest missed run (see below), so offsets then report on the period around that run alone,
while leaving the timing out reports on everything since the last successful report.

For example, this automation reports on the previous day, with the offsets above in ``report-parameters.yml``.
It runs every night at 1 AM, an hour after midnight, so that the day's last readings have had time to arrive:

.. code-block:: bash

flexmeasures add automation --asset 3 --name "Daily self-consumption report" --type reporting \
--cron "0 1 * * *" --timezone Europe/Amsterdam \
--reporter PandasReporter --config reporter-config.yml --parameters report-parameters.yml

Running automations
-------------------

Expand All @@ -83,7 +116,7 @@ Use one dispatcher for a deployment; the Docker Compose service already runs the

Each due automation then queues its jobs.
If the runner misses runs, because it was down or overloaded, it catches up when it resumes: it queues only the latest missed run of each automation, rather than replaying stale ones.
Timing parameters that default to the run time are resolved when that catch-up run is queued, so it produces a current forecast or schedule.
Timing parameters that default to the run time are resolved when that catch-up run is queued, so it produces a current forecast, schedule or report.

Each scheduled run receives at most one automatic queueing attempt.
If the process crashes, or queueing fails after creating some jobs, that run is not retried automatically, because a retry could duplicate partial work.
Expand Down
8 changes: 8 additions & 0 deletions documentation/features/reporting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,11 @@ Here, the ``ProfitOrLossReporter`` used as source (with Id 6) is the one we conf
With the offsets, we control the timing ― we indicate that we want the new report to encompass the day of tomorrow (see Pandas offset strings).

The report sensor will now store all costs which we know will be made tomorrow by the schedule.

.. _automating_reports:

Automating reports
--------------------

Comment thread
Flix6x marked this conversation as resolved.
Instead of computing reports one at a time, you can set up an *automation*: a recurring task defined on an asset, which queues reporting jobs on a cron schedule.
See :ref:`automations`.
Loading
Loading