> For the complete documentation index, see [llms.txt](https://docs.autommate.com/userguide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autommate.com/userguide/start-here/use-cases/employee-onboarding-example.md).

# Employee onboarding across HR, identity and IT

Coordinate onboarding from a new-hire record through account provisioning, collaboration access, equipment work and completion reporting. This example is a design pattern: select the actions and approvals appropriate to your organisation before enabling writes to identity or production systems.

## Define the onboarding contract

Use a stable employee identifier and collect the required name, start date, department, role, manager and location. Define which HR event starts the process and what makes a request ready to execute. Check that required approvals and input validation have completed before provisioning accounts.

Separate the overall onboarding result from individual tasks. An account created successfully does not mean equipment is assigned or every application is ready. Decide which missing tasks block completion and which should be handed to a person.

## Assemble the stages

```mermaid
flowchart TD
  H[New-hire event from HR] --> V[Read and validate employee details]
  V --> A[Create or match AD account and groups]
  A --> E[Set up Exchange mailbox and mail groups]
  E --> L[Assign approved Microsoft licences]
  L --> T[Add approved Teams memberships]
  T --> S[Update device ownership in ServiceNow]
  S --> Q[Create any required equipment tasks]
  Q --> D[Update internal records]
  D --> N[Send onboarding guidance and notify HR / IT]
  N --> R[Report completed and outstanding work]
```

This diagram restates the stages of the documented onboarding example. It does not imply that every connector action is installed or that these steps have already been run in your environment.

| Stage                          | Implementation detail to settle                                                                                                                                                                                                     |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HR trigger and employee lookup | Select the source event and retrieve authoritative employee values. Validate required fields before continuing.                                                                                                                     |
| Active Directory               | Match an existing identity or create one, then assign only the approved groups. Define collision handling for usernames.                                                                                                            |
| Exchange                       | Configure the mailbox and relevant mail groups using the account identifier produced earlier.                                                                                                                                       |
| Microsoft licences             | Check the intended product licence and assignment result. The older library is named **Azure Active Directory**; Microsoft now calls the identity platform Microsoft Entra ID.                                                      |
| Teams                          | Add the user to the approved teams or collaboration groups supported by the selected action.                                                                                                                                        |
| ServiceNow                     | Update the device assignment and create separate equipment requests for items still required.                                                                                                                                       |
| Internal records               | Update payroll or reporting systems only where included in the agreed scope. Record each system's returned ID.                                                                                                                      |
| Guidance and completion        | Send first-day instructions and approved access guidance, then report completed and outstanding steps to HR and IT. Use the organisation's secure credential delivery process; do not include passwords in a general welcome email. |

## Build and test in small increments

1. Connect the required [application credentials](/userguide/integrations-and-api/apps-connections-and-authentication.md) and choose a Mate Agent with access to the target systems.
2. Build the HR read and validation stages first. Map the source values to named [variables](/userguide/build-automations/variables-and-input-output-contracts.md).
3. Add one provisioning action at a time using approved test identities and systems. Verify the target result rather than only the chat or notification text.
4. Add conditions for an existing account, unavailable licence, missing manager and failed downstream call.
5. Define restart behaviour. A retry should recognise resources already created rather than blindly creating them again.
6. Verify the final completion report distinguishes success, failure and work awaiting a person.

For a repeatable service, organise these steps into reusable Work Items and bind customer or department configuration at deployment. Use the [Service Automation model](/userguide/service-automation/understand-the-service-model.md) to define the case's completion and result behaviour.

## Technical references

Use the [Active Directory](/userguide/integrations-and-api/libraries/integration/active-directory.md), [Exchange Web Server](/userguide/integrations-and-api/libraries/integration/exchange-web-server.md), [Azure Active Directory](/userguide/integrations-and-api/libraries/integration/azure-active-directory.md), [Microsoft Teams](/userguide/integrations-and-api/libraries/integration/microsoft-teams.md), [ServiceNow](/userguide/integrations-and-api/libraries/integration/servicenow.md) and [Email](/userguide/integrations-and-api/libraries/integration/email.md) library guides for action-specific fields. Follow [error handling](/userguide/operate-and-troubleshoot/handle-errors-and-debug-a-flow.md) and [Monitoring](/userguide/operate-and-troubleshoot/monitor-executions-and-retain-useful-evidence.md) to diagnose an incomplete onboarding run.
