Skip to content

User Functions

A User Function is a customizable extension point that allows organizations to enhance and personalize the behavior of the Hire2Retire workflow without modifying its core logic. It enables users to plug in their own scripts or subroutines—hosted externally—to address specific business requirements or policies.

When integrated with Hire2Retire, these functions are executed at runtime, allowing dynamic interaction between the core workflow and your custom logic. This provides a flexible and powerful way to implement organization-specific validations, transformations, or actions.

In the current implementation, Hire2Retire supports integration with Azure Functions, enabling you to configure and trigger your own Entra ID-hosted logic in response to lifecycle events such as hiring, role changes, or terminations.

Entra ID Service Bus Connection Form

Hire2Retire uses Entra ID Service Bus to securely send employee lifecycle events (like hiring, role changes, and terminations) to your Azure Function. To establish this connection, we need the following details:

  • Service Bus Namespace
  • Shared Access Policy Name (Key Name)
  • Primary Key

These credentials allow Hire2Retire to authenticate and publish messages to your Service Bus queue or topic, triggering your Azure Function as part of your automation flow.

  1. Service Bus Hostname: This is the globally unique name of your Service Bus instance. To find it:

    • Go to the Azure Portal → https://portal.azure.com
    • In the search bar, type Service Bus and select your namespace.
    • On the Overview tab, locate the Service Bus Namespace at the top.
  2. Key Name : This is the name of the Shared Access Policy used to authenticate. To find it:

    • In your Service Bus namespace, go to SettingsShared access policies.
    • You'll see a list of policies – the policy name is the Key Name.
  3. Primary Key: This is the actual secret used to sign and authorize Service Bus requests. To find it:

    • Click on your chosen policy (from the previous step).
    • The Primary Key* is shown on the right.
    • Click the copy icon to copy it securely.

Once you have all three values, enter them into the connection form to establish a secure link with your Entra ID Service Bus.

Azure Function Connection Form

User Function configuration

  1. User Function Configuration name: The name of the current configuration. This value will be displayed in Observe page event to identify the event from this User Function. It is advised to have a unique name for each configuration.

  2. Choose Lifecycle activity: Choose lifecycle operations on which the User function will be triggered.

  3. Employee processing condition: Process only employees who meet defined conditions. Azure Function Form

  4. Publisher Queue Name: Queue name to which employee data will be sent. Your Azure function should listen to this queue to receive payload.

  5. Message Headers: Each message will contain 2 system defined headers -

    • Correlation ID: This will be added by Hire2Retire. This field will be used to correlate the Entra ID function response with the Hire2Retire core event. Response sent by the customer’s Entra ID function must have this field and the value should be the same as the one present in the payload received by it.
    • Time to live: By default, this value is set for 14 days by Entra ID service bus. Customers can change it by defining it as a custom header on the Hire2Retire UI.
    • In addition to these system-defined headers, user can define Custom Headers suitable to their use.
  6. Message Payload: Users can define payload according to their use case. They can either put a static value or map HR/AD attributes.

  7. Receiver Queue Name: Queue name to which Hire2Retire will receive the response from the Azure function. Your Azure function should publish response to this queue.

  8. Sample Success/Failure Payload: A non-editable text box will be shown, which will contain all the required fields with their respective data type, as expected by Hire2Retire Azure Function response.

AzEntra IDure Function Form