> For the complete documentation index, see [llms.txt](https://docs.xyb.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyb.co/xyb-console/workflow-management/automation-tutorial-employee-offboarding-handoff.md).

# Automation Tutorial - Employee Offboarding Handoff

This automation is used to create and assign a follow-up task automatically when an employee is disabled in the system. It helps ensure that responsibilities owned by the deactivated employee are reviewed or transferred, so nothing gets left behind.

When an employee is disabled, the system detects this internal event and automatically creates a follow-up task. The task is assigned directly to a specified user or group for further action, such as reviewing and reassigning the disabled employee’s responsibilities..

#### Step 1: Start a New Automation

1. Navigate to **Workflows < Automations**.
2. Click **+ New Automation**.
3. Fill in the details:

   <div align="left"><figure><img src="https://1792085566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkIq1PGbSmC3vQR1DFPNM%2Fuploads%2Fgit-blob-7e5802c21f48cca0282e985f3f303dfb9abdc122%2Fimage.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

   * **Automation name**: Employee Offboarding Handoff
   * **Automation reference**: You can leave it as the default unless you need a custom reference.
   * **Description**: Write a simple description of the workflow.
4. Click **Create automation**.

#### Step 2: Add the Trigger

1. On the canvas, click the **Start** node and select **Internal Event**.

<figure><img src="https://1792085566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkIq1PGbSmC3vQR1DFPNM%2Fuploads%2Fgit-blob-d9049a5f3a7d5d37ae877b9534043ba6e527b23f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Choose the trigger: **Employee is disabled**.

<div align="left"><figure><img src="https://1792085566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkIq1PGbSmC3vQR1DFPNM%2Fuploads%2Fgit-blob-5ea89e4db905ef66e6a008e4ef8b3694990428e0%2Fimage.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

2. The event will expose the following variables:
   * `{EmployeeEmail}`
   * `{EmployeeId}`
   * `{EntityReference}`
3. Click **Save**

#### Step 3: Create and Assign the Task

1. Click the **+** button next to the event node.
2. Select **Task** < **+Add**

<div align="left"><figure><img src="https://1792085566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkIq1PGbSmC3vQR1DFPNM%2Fuploads%2Fgit-blob-9d251acaa17cd112130595dedaf56162dfd3fda5%2Fimage.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

3. In the Task window, select the **Change assignee** tab.
4. Provide the **Reassign from** email variable and the **Assign to** email/variable. In this tutorial, we're assigning the review task to the operations team.

<div align="left"><figure><img src="https://1792085566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkIq1PGbSmC3vQR1DFPNM%2Fuploads%2Fgit-blob-cf33bcdee37fd7c297eb9bf8236d22e85aaaaa6b%2Fimage.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

5. Provide the instructions under **Task description** and click **Save**.
6. Once the steps are configured, click **Activate** in the top-right corner of the screen.

**Result**

When an employee like is deactivated:

* The automation is triggered.
* A task is immediately created and assigned to the operations team.
* The task includes context about the deactivated employee for easy follow-up.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xyb.co/xyb-console/workflow-management/automation-tutorial-employee-offboarding-handoff.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
