Ok so I’ll try to clarify my problem. It’s slightly more precise. In reality, I want to regulate the flow of my stripe events that I receive in a webhook.
It looks like a traffic light. If a single event arrives in the space of a minute, then no problem, I let the flow run. But if two events arrive too close together, say in less than a minute, I don’t want the activepieces flow to be triggered until it has completed its execution on the first event.
As I understand it, in this case I have to create two flows and use a locking key with storage. The first flow has a router which will only store in the queue if the flow is already running. The second flow executes the desired processing on the webhook. This second flow is called instantaneously if the last processing took place more than a minute ago, otherwise it is executed with a delay.
Am I summarising the situation correctly? Is this the right strategy? I find it very complicated for a very simple problem: making sure that the flow doesn’t run simultaneously on two events.