Keyboard Maestro (KM) lets the user build "macros" in a graphical way, similar to Apple's Automator and Shortcuts, but provides many more "triggers" (ways, or things happening, to start a macro running) and can control more things. Macros you produce are stored in its library along with the many supplied examples. KM is usually set to run when the Mac starts-up and installs itself on the Menu Bar as well as responding to the programmed hot keys and events.
Andrew gave several interesting demos of building workflows by dragging actions into a sequence (as with Automator) but pointed out that KM has more powerful controls, including if/then/else style conditions and loops (to repeat actions on, for example, many files or lines of text).
KM actions can trigger any menu item for any app, starting it first if necessary. They can interact with windows, including dialogue boxes, and simulate clicking buttons etc. KM can interact with buttons that simple appear as icons (Andrew used the Notification Centre icon at the righthand end of the Menu Bar as an example) by recognising their icon from an image suppled to the macro.
Macros can include Variables, to contain values including those that might be found while running, and Tokens that act like variables but contain information about the system (eg is the Mac using Dark Mode).
The application is very capable and is supported by an active user forum (where the author also contributes). It costs $36 + VAT that currently comes out as less than £35.