# 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 based on the selected Task type.
6. Once done, click SAVE CHANGES

## Results

TIP

When writing a Task config, it’s often necessary to reference VM Essentials variables which pertain to the specific Instance the Task is being run against. VM Essentials 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 VM Essentials 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 VM Essentials 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.
