Similar to this, but broader scope:
I raised a feature request some time ago but it seems to be lost. I commented in this feature request about a "Macro" System:
The idea is based around having a set of custom automated tasks or macros, which run when certain actions are performed. Some of these tasks could maybe be scheduled to run at a certain time interval, much like CRON jobs, or in response to actions.
For example. I have built an external CRON based PHP system which accesses API for two different tasks.
Task #1 - Children
Every night at midnight, the task looks for children who:
  • Have an enrolment date (for our kids program)
  • Have no unenrolment date
  • Checks their demographics and ensures they are in the "Kids" group AND the relevant demographically defined program group. i.e. if they are in Grade 4-6, they are added to our "GANG" group.
  • If they are found to be in any of the other program groups, they are removed
This helps us greatly with generating reports. It also provides an audit trail of their progression through kids program.
Task #2 - Youth
Every 5 minutes, the task runs to check similar things to our kids program. Checks for youth enrolment and places them in appropriate "small groups" for their gatherings. These groups are school grade AND gender based.
The reason this task runs at 5 minute intervals is because when a new youth is invited to one of the gatherings, the team leader fills out a "New Youth Form" with the relevant details when they arrive.
Within the 5 minute window, the new youth is added to the appropriate group and the leader can mark their attendance in the group report.
Basic functionality of automated/macro tasks:
  • Time interval or action based
  • Can be targeted to specific people categories, demographics or field changes
  • Perform an action or multiple actions
  • Optional notifications to the admin
  • Lockdown this area or feature to certain access permissions or make it a settings only feature
Side note about groups. The actions around using an automated task to remove a person from a group would be that the logic would need to query if person is in group first. If they are, and they shouldn't be, then they can remove them. I have noticed that if you remove a person from a group via API and they were not actually in that group, this activity is still logged for the person and the group.