Skip to main content
Version: 25.6

Execution of a microservice after user login

Automatic execution of a microservice after a user logs in can be efficiently implemented using Flows. This method is ideal for scenarios where specific validations or tasks need to be performed once a day, as in the following example:

Requirement

Each day, when the user logs in, a validation or execution must be carried out through a microservice.

Components of the requirement

  • Condition: User login.
  • Action: Microservice execution.
  • Maximum Recurrence: Once a day.

Flow Configuration

To meet the requirement, a flow can be defined using the condition Presence of an ongoing process. This allows monitoring and acting upon the presence of specific processes in the system using the following parameters:

  • Check every. Defines the timeframe for checking the process status.
  • Operator. Allows filtering processes by name using operators like Equal, Starts with, Ends with, and Contains.
  • Value. The specific name of the process to monitor.
  • Period. The minimum time the process must be running for the condition to trigger.

condition-process

In the image above, the condition configuration indicates that every 5 minutes (Check every), the existence of a process named Equal (Operator) to explorer.exe (Value) will be checked and verified if the process has been running for a minimum period of 5 minutes (Period).

Daily Recurrence Control

Although the previous configuration ensures the flow execution at each login, the user might log in more than once a day. That's why it is essential to configure the Cooldown Time, as it defines the minimum period that must pass before the condition can be evaluated and triggered again, once the condition has been fulfilled and an action executed.

flow-cooldown

By setting a cooldown time, the flow will execute the action the first time the condition (login) is met but won't reactivate until 24 hours have passed since the last execution. This ensures that the microservice triggers at most once a day, fulfilling the required recurrence.