# Task Management

## Adding Tasks

### Procedure

1. Select Automation from within the Library menu
2. On the Tasks tab, click the Add button
3. From the New Task Wizard input a name for the task
4. Select the type of task from from the type dropdown
5. Input the appropriate configuration details. These will vary signficiantly based on the selected Task type. More details on each Task type are contained in the preceding sections.
6. Once done, click SAVE CHANGES

### Results

TIP

When writing a Task config, it’s often necessary to reference HPE Morpheus Enterprise variables which pertain to the specific Instance the Task is being run against. HPE Morpheus Enterprise includes a pop-out column along the right side of the Add/Edit Task modal which lists available variables. Click and drag the relevant variable into the config area and HPE Morpheus Enterprise will automatically fill in the variable call formatted for the currently chosen Task type. See the screenshot below.

TIP

When writing a Task that calls back into the HPE Morpheus Enterprise API, pass an `Authorization: Execution <%=executionLeaseToken%>` header. The system API will authenticate against that during the life of the Task execution only. This is preferred over other methods of authorizing Task calls as there was a risk of the token expiring in the middle of the Task run.

![../../_images/taskvars.png](https://support.hpe.com/hpesc/public/api/document/sd00008375en_us/GUID-BA459071-AEAD-4E96-8DB9-FD67DDE9ABC5-high.png)

## Editing Tasks

### Procedure

1. Select Automation from within the Library menu
2. Click the pencil icon (✎) on the row of the task you wish to edit
3. Modify Task as needed
4. Once done, click SAVE CHANGES

## Deleting Tasks

### Procedure

1. Select Automation from within the Library menu
2. Click the trash icon (🗑) on the row of the Task you wish to delete
