EmpowerID Workflows in the Microservices
EmpowerID workflows are essential for executing critical business processes such as approvals and onboarding tasks within the microservices-based architecture. These workflows, referred to as Legacy workflows, integrate seamlessly into the microservices framework through a flexible system that adapts to environment configurations. Depending on these configurations, workflows can either embed directly within the application interface or open in separate browser tabs, ensuring both flexibility and a consistent user experience.
While workflows are heavily utilized in Resource Admin, they are also available in other microservices, such as the IAM Shop.
Integration of Workflows into the Microservices Application
The integration of EmpowerID workflows provides adaptability and a smooth user experience. Two primary mechanisms support this integration: embedding workflows within the application via an iframe or launching workflows in a new browser tab.
By default, workflows are embedded within an iframe, keeping users within the microservices application's interface while completing their tasks. This approach ensures visual and functional continuity, making the workflows feel like a natural part of the application. Alternatively, workflows can be configured to open in a new browser tab, providing a degree of separation while maintaining necessary communication between the workflow and the main application.
Note: The same integration mechanisms apply whether workflows are accessed through Resource Admin or other microservices such as the IAM Shop.
Configuration Options for Workflow Behavior
The behavior and integration method for Legacy workflows are managed through the application's window.config
object. This centralized configuration system provides fine-grained control over how workflows are displayed and initialized.
EMBEDED_WORKFLOWS
Parameter
This parameter determines the integration approach:
When set to
true
(the default), workflows are embedded within an iframe in the main application interface.When set to
false
, workflows open in a separate browser tab.
WORKFLOW_WAIT_TIME
Parameter
This parameter manages initialization timing:
Specifies the delay, in seconds, before the workflow is displayed.
During this delay, the application shows a loading indicator or progress bar, allowing Legacy EmpowerID cookies and session data to initialize.
If not explicitly configured, a default wait time of five seconds is applied.
These configuration options ensure workflows operate predictably and efficiently across different microservices.
Workflow Execution Flow
The execution of an EmpowerID workflow follows a structured sequence to ensure smooth operation, from initiation to completion. Below are the key phases of this process:
Initiation Phase
Users trigger a workflow by navigating to a specific route or clicking a button in the microservices interface. The application first checks the EMBEDED_WORKFLOWS
configuration to determine whether the workflow should appear embedded in an iframe or open in a new browser tab.
Loading and Initialization
If the workflow is embedded, the application displays a loading indicator or progress bar for the duration specified in the WORKFLOW_WAIT_TIME
parameter. This delay allows time for EmpowerID’s session data and cookies to initialize, ensuring the workflow runs smoothly when loaded. If no custom WORKFLOW_WAIT_TIME
is configured, a default five-second delay is applied.
Workflow Launch
The application constructs a URL pointing to the workflow endpoint and launches the workflow in the chosen integration mode:
Iframe Integration: The workflow loads directly within the microservices interface, allowing users to interact without leaving the application.
New Tab Integration: The workflow opens in a separate browser tab, maintaining a connection to the main application while operating independently.
Completion Phase
Workflows conclude either upon successful completion or cancellation. How this is handled depends on the integration mode:
Iframe Integration: EmpowerID communicates completion or cancellation using the
postMessage
API. The application processes this event to refresh data or display a success message.New Tab Integration: Users close the browser tab to end the workflow session. Any necessary state updates or cleanup tasks are managed by the main application.
This phased approach ensures that workflows operate reliably and provide a consistent user experience, whether they are run in Resource Admin or the IAM Shop.
Managing Workflow Lifecycle and Events
EmpowerID workflows use a robust event communication system to manage state changes and interactions between the workflow and the microservices application. This system relies on the browser's postMessage
API to facilitate communication.
Session Management and Security
The application actively monitors session status and manages session expiration events. For iframe-embedded workflows, if EmpowerID detects an expired session, it sends a "SessionEnded" message to the application, which redirects the user to a session management or sign-out page.
State Transitions and Updates
Workflow completion or cancellation is signaled through specific messages, such as "WorkflowEnded" or "WorkflowCanceled." These messages are processed by the application, triggering actions like data refreshes or user notifications. This ensures the main application always reflects the current state of workflow operations.
Resource Management and Cleanup
To maintain optimal performance, the microservices application implements resource cleanup procedures when workflows conclude. This includes removing postMessage
event listeners to prevent memory leaks and ensuring the system remains efficient during prolonged usage.