Hello ;)
I would recommend to not try to execute any action every single second because it would be a massive performance issue for your application.
I would rather create something like a webhook or some form of a script / app outside your application which has the single responsibility of checking every second if it should send something to your app. So your app would have to expose an API that would be consumed by this outside hook.
If we have to be stubborn and really do it in an app we could try to create a forever running microflow based on an infinite loop idea by using the community commons delay. But this should be really shaky. I would also think about some sort of a safe mechanism about it. I am not sure how long would the microflow run. We may have to terminate it and start it again somehow. Also, consider doing this via task queues.
There's also another option. Probably this would also be something you should consider. There's an API method in the Core library. Check out the link.
public static <R> void scheduleAtFixedRate(String actionName, Date firstRun, long period, TimeUnit timeUnit, String name, String description)
Schedule a periodic action that runs for the first time after the given initial delay (first run), and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. No result will be returned.
Type Parameters:
R - result type of the action, which should be Object
Parameters:
actionName - the name of a microflow or Java action (format "ModuleName.ActionName")
firstRun - the date on which the action will be executed the first time
period - the period between each start of the execution of the action
timeUnit - the timeUnit in which the initialDelay and the period is specified
name - the name of the scheduled event
description - the description of the scheduled event