Need to get 1 min windows and apply conditions to the records in the window

HI,
Pls pardon my basic newbie question.
I want to take the 12 InfluxDB records that should be in each of the last 1 min window and apply 2 separate conditions to the 12 rows.
Is this the right way to get each consecutive 1 min window using window and period(1m) and every(1m) ?

var measurement string
var where_filter = lambda: TRUE
var groups =
var crit lambda

stream
|from()
.measurement(measurement)
.where(where_filter)
.groupBy(groups) //.groupBy(time(1m), *) ?
|window()
// keep a buffer of the last 1m of records
// just in case a record hasn’t updated in a while
.period(1m)
// Emit the current records every min.
.every(1m)
// Align the window boundaries to be on the minute.
.align()
|alert()
.crit(crit)

TIA,