# Workflow Tasks [OpManager's workflow feature](https://www.manageengine.com/network-monitoring/it-workflow-automation.html) helps users with fault remediation by automating the preliminary corrective actions to be taken, in case of a mishap. The workflow tasks are nothing but checks and actions that help you automate IT actions that are repetitive. **Checks:** Checks are if-else condition based. If the condition is passed/satisfied, the workflow executes the set of actions associated on the success part, executes the other set of actions associated on the failure part. Example: Consider that you have created a workflow with Test a Service, Send Mail, and Start a Service tasks. Send Mail is associated on the success part of Test a Service, and Start a Service is associated on the failure part. If the service is running, workflow executes Send Mail task to notify the admin that the service is running, else executes Start a Service task to start the service. **Actions:** An action just performs the said activity. Tasks such as start a service, delete file, reboot system are action tasks. If an action task is executed successfully, workflow executes the next successive task. If an action task fails, action task associated on the failure part is executed. Example: Consider that you have created a workflow with 2 action tasks - Start Process and List All Process. List All Process is associated to the success part of the Start Process task. When the workflow is executed, in case if the Start Process task fails, workflow looks for the task associated on the failure section. If no task is found, the workflow executes the task in the success section i.e., List All Process. ## Conditions and Actions available in Workflow | Category | Type | Task | Description | |---|---|---|---| | Device | Check | DNS Lookup | Executes a DNS lookup command on the end device. | | Device | Check | Ping Device | Sends ICMP packets to the end device. | | Device | Check | Trace Route | Executes a trace route command on the end device. | | Device | Action | Add a Time Delay | Adds a delay to the execution of an action | | Device | Action | Reboot System | Reboots the system | | Device | Action | Shut Down System | Shuts down the system | | Windows Service | Check | Test a Service | Tests whether a service is running or not. | | Windows Service | Action | Get Active Services | Provides a list of service that are currently running. | | Windows Service | Action | Pause/Restart/Resume/Start/Stop a Service | Pauses/Restarts/Resumes/Starts/Stops a service. | | Process | Check | Test a Process | Test whether a process is running or not. | | Process | Action | List All Processes / By Disk Read / Write / Memory / CPU | Lists processes by usage metrics or all processes. | | Process | Action | Start Process | Starts a process. | | Process | Action | Stop Process | Stops a process. | | HTTP & FTP | Check | Check URL | Test the availability of a URL. | | HTTP & FTP | Action | FTP Delete/Move/Rename/Upload File | Performs FTP file operations. | | HTTP & FTP | Action | HTTP Post Data/Result | Posts the output received upon querying a URL in the workflow logs. | | File | Check | Check File | Checks the availability of a file. | | File | Check | Get File Size | Gets the size of a file. | | File | Action | Compress/Delete/Copy/Move/Rename/Uncompress File | Performs file operations. | | Folder | Check | Check Drive Free Space | Checks for free space available in a drive. | | Folder | Check | Get Folder Size | Gets the size of a folder. | | Folder | Action | Folder Operations | Compress, copy, create, delete, move, rename, list, uncompress folder. | | VMware | Action | VM Operations | Power, reboot, reset, snapshot, suspend, etc. | | OpManager | Check | Check Device Status | Checks the availability status of a device. | | OpManager | Action | Alarm Actions | Acknowledge, clear, delete, suppress, generate, rediscover, maintenance. | | External Actions | Action | Execute Scripts / Send Notifications / Log Tickets | Executes scripts and sends notifications or logs tickets. | | NCM Actions | Action | Backup / Execute Command / Template / Get Last N Changes | Network configuration actions. | | Hyper-V | Action | Power On/Off VM | Control Hyper-V VMs. | --- ## DNS Lookup DNS Lookup executes a DNS lookup command on the end device and provides its status. | Parameter | Description | |---|---| | Name | Display name for the task. | | Destination Device | Device on which the task has to be executed. Click on the select devices icon to select the device. If no device is selected, it will be executed on the device selected in the Info tab. | ## Ping Device Sends ICMP packets to test whether the device is responding. | Parameter | Description | |---|---| | Name | Display name for the task | | Destination Device | Device on which the task has to be executed. Click on the select device icon to select the device or use ${DeviceName} variable. ${DeviceName} will be replaced with the name of the device selected in the Info → Devices during workflow execution. | | Number of requests | Number of ping requests you want to send. | | Packet Size | Size of the ping packets. | | Timeout | Timeout interval for the ping requests. | | Retries | Number of retries for the ping operation. | ## Trace Route Executes a trace route command on the end device. | Parameter | Description | |---|---| | Name | Display name for the task | | Destination Device | Device on which the task has to be executed. Click on the select device icon to select the device. | ## Add a Time Delay Adds a delay to the execution of the subsequent operation. | Parameter | Description | |---|---| | Name | Display name for the task. | | Duration | Time delay to carry out the subsequent task. Configure time delay in hours, minutes, or seconds. | ## Reboot System Reboots a remote Windows machine. | Parameter | Description | |---|---| | Name | Display name for the task. | | Destination Device | Device on which the task has to be executed. Click on the select device icon to select the device. | ## Shut Down System Logs off, shuts down, reboots or powers off a remote Windows device forcefully. | Parameter | Description | |---|---| | Name | Display name for the task. | | Destination Device | Device on which the task has to be executed. | | Options | Select the action (Log off, Shut down, Reboot or Power off). | ## Variables Variables are used to append dynamic values in a field of a task. - ${DeviceName} - Name of the device to which workflow has to be associated. - ${WorkflowName} - Name of the Workflow that is triggered. - ${Alarm.ServiceName} - Name of the service for which an alarm is raised. - ${URLAddress} - URL address. - ${Alarm.URLAddress} - URL address for which an alarm is raised. - ${UserName} - Username of the device. - ${Password} - Password of the device. - ${Device.DisplayName} - Display name of the device for which an alarm is raised. - ${Alarm.ProcessName} - Name of the process for which an alarm is raised. - $message - Alarm message displayed. ## Using Variables Variables can be better understood with an example. Following is the workflow that has to be triggered as an action whenever a service down alarm is raised. ![Workflow actions in OpManager: Workflow setup](https://www.manageengine.com/network-monitoring/help/images/worksflow.png) **Task 1:** ‘Test a service’ task is created to test the service that is down. When the workflow is triggered, the variable ${Alarm.ServiceName} is replaced with the name of the service that has gone down. ${DeviceName} is replaced with the name of the device. ![Workflow actions in OpManager: Test a service](https://www.manageengine.com/network-monitoring/help/images/Screen-Shot-2018-05-03-at-1.45.42-PM.png) **Task 2:** The result of previous task (service up or down) is added as notes to the alarm using ${Result} variable. (This variable is not yet implemented in the current build.) ![Workflow actions in OpManager: Add alarm note](https://www.manageengine.com/network-monitoring/help/images/Screen-Shot-2018-05-03-at-1.47.32-PM.png)