[GH-ISSUE #508] [Feature] Rules for Budget Automation #25973

Closed
opened 2026-04-18 01:47:53 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @rich-howell on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/508

Discussed in https://github.com/actualbudget/actual/discussions/372

Originally posted by shall0pass October 22, 2022
I could see a use case to extend the Rules system to include automations for the budget screen.

For example: You could run a rule once a month to look for category overspending and have the rule move the overspending to a credit account.

If (category.available) is <0

Set (creditcategory.budgetamount) to (creditcategory.budgetamount + category.available)
Set (creditcategory.budgetamount) to (category.budgetamount - category.available)

I think this could be useful as single shot rules where they are only run on user request or as a scheduled run.

Originally created by @rich-howell on GitHub (Jan 22, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/508 ### Discussed in https://github.com/actualbudget/actual/discussions/372 <div type='discussions-op-text'> <sup>Originally posted by **shall0pass** October 22, 2022</sup> I could see a use case to extend the Rules system to include automations for the budget screen. For example: You could run a rule once a month to look for category overspending and have the rule move the overspending to a credit account. If (category.available) is <0 Set (creditcategory.budgetamount) to (creditcategory.budgetamount + category.available) Set (creditcategory.budgetamount) to (category.budgetamount - category.available) I think this could be useful as single shot rules where they are only run on user request or as a scheduled run. </div>
GiteaMirror added the feature label 2026-04-18 01:47:53 -05:00
Author
Owner

@MatissJanis commented on GitHub (Mar 30, 2023):

cc @j-f1 can this be achieved with budget templates?

If yes: I think we can close this issue.

<!-- gh-comment-id:1490828851 --> @MatissJanis commented on GitHub (Mar 30, 2023): cc @j-f1 can this be achieved with budget templates? If yes: I think we can close this issue.
Author
Owner

@j-f1 commented on GitHub (Mar 30, 2023):

Maybe, although I am not sure if it is this powerful yet.

<!-- gh-comment-id:1491076441 --> @j-f1 commented on GitHub (Mar 30, 2023): Maybe, although I am not sure if it is this powerful yet.
Author
Owner

@github-actions[bot] commented on GitHub (May 1, 2023):

Thanks for sharing your idea!

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution).

The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!

<!-- gh-comment-id:1530130170 --> @github-actions[bot] commented on GitHub (May 1, 2023): :sparkles: Thanks for sharing your idea! :sparkles: This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution). The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+ Don’t forget to upvote the top comment with 👍!
Author
Owner

@shall0pass commented on GitHub (May 9, 2023):

I was thinking about this again today. I don't think it would be too difficult to add a couple of keywords to the #template system to accomplish this.

I think we'd want a separate menu option to activate this script so it isn't run with the target goals.

My initial thoughts:

#template source -- Any matching template lines with this string would bring the balance of that category to 0 and move all excess funds back to "To Budget". It's a 'source' of fund reallocation.

#template sink
#template sink 50% -- These are run immediately after the 'source' routine has found additional funds. If no % is given, 100% will be applied to the category (only 1 could be funded). If a percentage is given, the script will split the funds amongst several identified categories.

There is a possibility to also incorporate funding over-spent categories before applying excess funds to the 'sink' categories.

<!-- gh-comment-id:1540636632 --> @shall0pass commented on GitHub (May 9, 2023): I was thinking about this again today. I don't think it would be too difficult to add a couple of keywords to the #template system to accomplish this. I think we'd want a separate menu option to activate this script so it isn't run with the target goals. My initial thoughts: #template source -- Any matching template lines with this string would bring the balance of that category to 0 and move all excess funds back to "To Budget". It's a 'source' of fund reallocation. #template sink #template sink 50% -- These are run immediately after the 'source' routine has found additional funds. If no % is given, 100% will be applied to the category (only 1 could be funded). If a percentage is given, the script will split the funds amongst several identified categories. There is a possibility to also incorporate funding over-spent categories before applying excess funds to the 'sink' categories.
Author
Owner

@youngcw commented on GitHub (May 9, 2023):

I don't know if it matters in the long term, but I could see using #template for both goals and these cleanup rules being confusing. I would think it would also be easier to implement if it was a different tag. Maybe we could even change the goal templates to be #goal and this to be something like #monthend or #cleanup.

<!-- gh-comment-id:1540881433 --> @youngcw commented on GitHub (May 9, 2023): I don't know if it matters in the long term, but I could see using #template for both goals and these cleanup rules being confusing. I would think it would also be easier to implement if it was a different tag. Maybe we could even change the goal templates to be #goal and this to be something like #monthend or #cleanup.
Author
Owner

@shall0pass commented on GitHub (May 9, 2023):

I have doubts that the text string in the notes will be sustained when goals becomes a non-experimental feature. We could certainly use a different # for the end of month routines, but I thought we could keep from recreating a lot of work by simply using what's already there and defining with keywords. It should be easy enough to keep everything separated in the code.

I put together a proof of concept PR. https://github.com/actualbudget/actual/pull/1016

<!-- gh-comment-id:1540912316 --> @shall0pass commented on GitHub (May 9, 2023): I have doubts that the text string in the notes will be sustained when goals becomes a non-experimental feature. We could certainly use a different # for the end of month routines, but I thought we could keep from recreating a lot of work by simply using what's already there and defining with keywords. It should be easy enough to keep everything separated in the code. I put together a proof of concept PR. https://github.com/actualbudget/actual/pull/1016
Author
Owner

@shall0pass commented on GitHub (May 10, 2023):

I don't know if it matters in the long term, but I could see using #template for both goals and these cleanup rules being confusing. I would think it would also be easier to implement if it was a different tag. Maybe we could even change the goal templates to be #goal and this to be something like #monthend or #cleanup.

I took your advice and also added some screen grabs of how it currently works. I don't think the wording is right (menu item, keywords( sink, source), function names, etc), but the idea seems to work ok.

<!-- gh-comment-id:1541880462 --> @shall0pass commented on GitHub (May 10, 2023): > I don't know if it matters in the long term, but I could see using #template for both goals and these cleanup rules being confusing. I would think it would also be easier to implement if it was a different tag. Maybe we could even change the goal templates to be #goal and this to be something like #monthend or #cleanup. I took your advice and also added some screen grabs of how it currently works. I don't think the wording is right (menu item, keywords( sink, source), function names, etc), but the idea seems to work ok.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#25973