Feature Proposal: Support for Recurring Tasks Linked to Controls
Feature Request: Recurring Tasks for Controls
Hi team,
First of all, thanks for your amazing work on this project 🙌
We're exploring your project for a GRC use case and were wondering if there's any plan to support recurring tasks linked to controls.
These would be tasks that need to happen on a regular basis — not just one-time implementations — such as:
- Monthly backup verification
- Quarterly access reviews
- Annual certificate renewals
Right now, it seems like all tasks are tied to implementations (measures), but these recurring operational activities are essential for maintaining compliance over time.
Is something like this already planned?
If not, we’d love to propose it as a feature and are happy to help contribute.
Thanks!
Thanks for your message. Yes we intend to implement this feature in the future and don't hesitate if you want to contribute.
hey @SachaProbo would like to take this up,
have mentioned by plan below, THOUGHTS??
PLAN
extend task model with a is_recurring field and a recurring_state field. this recurring_state will be a json and will have next_creation_date(when this task is next created), frequency(like quaterly,monthly,anually with respect to the date of creation of task), and a parent_id (self join), when paernt_id is empty then this is the first task for this recursive relation, and all other recursive task will look at the parent for the task metadata like name desc etc
continue to have this Task -> Measure -> Control. no direct task-to-control link. to link a recurring task to a control, first link the measure to the control , then link the task to that measure.
a background worker runs periodically (daily) to check for tasks with is_recurring true and no parent_id and this worker checks for the due date. when the due date is reached, it creates a new task instance by copying task properties (name, description, measure_id, assigned_to, etc.) from the parent task, setting the new instance's state to TODO, and updating the parent task's recurring_state->'next_due_date' to the next period based on the frequency pattern.
the created_at field of the first task of this recurrence relation, is the date when this recurrence was first created.
Example
say on January 1st, the background job finds a task with next_creation_date = '2024-01-01' in its recurring_state. it creates a new task instance on that date, copies all relevant properties from the parent, and updates the parent task's next_creation_date to February 1st (for monthly recurrence). this creates new instances automatically while maintaining the link to the original measure and, through it, to the associated control.
cc @gearnode @codenem
Hello! I think it would be best to have a new table storing the task recurring state (instead of first task):
- last revision (time.Time)
- recurring expression in RRULE format (https://datatracker.ietf.org/doc/html/rfc5545) (+ it handles exceptions) if we ever need to connect with calendars or CRON (but is less flexible for calendar like with human input features)
- timezone?
Hello! I think it would be best to have a new table storing the task recurring state (instead of first task):
* last revision (time.Time) * recurring expression in RRULE format (https://datatracker.ietf.org/doc/html/rfc5545) (+ it handles exceptions) if we ever need to connect with calendars or CRON (but is less flexible for calendar like with human input features) * timezone?
pardon for replying late, was doing some other pr
-
can we also add
next_runfield, because using just thelast_revisionwe will have to query all records in the task_recurrence table and calculate the next run for each, but with thenext_runwe can index this and can only get those which tasks which satisfiesnext_run<=now, thoughts?? -
for timezone, we can store another field
timezoneIANA string, we will store the time in UTC and convert to the respective tz dynamically in the worker. in the frontend we can have a list of timezones which we can show as dropdown for the users to select. thoughts?? -
what should be the frequency of the worker? 1 minute?
thoughts?? @codenem