Create an Automation Workflow
This page details the steps to create a new Automation workflow.
Note
If you are just updating an out-of-the-box workflow, then go to Step 2 directly.
Step 1: Create a new Automation Workflow
- As an Administrator, click the Automation icon.
The Automation page appears. - Click the Workflows tab.
- Click New Workflow.
- Provide a Name and Description to your workflow and click Save.
The new Automation workflow appears in the Workflows list. - Click the workflow Name to start designing the workflow.
Note
When you click on any workflow, the Automation Workflow Designer opens in a new tab. If that does not happen, please open a Support Ticket or send an email to support@serviceaide.com.
Workflow Name must be unique
Ensure that the Workflow Name is unique, the system does not allow creating a duplicate Workflow Name. If a Workflow is deleted, even then a new Workflow with the same name cannot be created. The name is cached and hence a duplicate is not allowed.
Step 2 : Design the Workflow by adding Operations
- On the Workflows tab, click the Name link to open your workflow in the Automation Workflow Designer.
A basic workflow with a Start and Stop point appears on the canvas. - Click Call Service + on the left pane to add an Operation to the canvas.
- Double-click the Call Service entity just added, to open the Call Service Activity Configuration window and configure it.
- Configure the Activity Details:
- Specify the name of the Operation under Activity Name field.
- The Activity Id is set automatically.
- Add a description under Activity Purpose field.
- Select an OOTB Operation from the 'Select a Service' list. A complete list of OOTB Operations is available at Out-of-the-box Automation Operations and Workflows.
- Click Next to go to the next tab.
- Configure the Service Input for the Operation in the Workflow.
- Define the Service Inputs that the Operation will receive from an external system, which it will then use to execute the task. For example, to Reset AD User password, the inputs the Operation will need is sAMAccountName of AD User, which will be passed from the skill attribute to the workflow. Input is an object that consists of all input fields and you can use it by typing
input.field_name.
- Click Save Draft on the Workflow Designer to save the changes.
- Define the Service Inputs that the Operation will receive from an external system, which it will then use to execute the task. For example, to Reset AD User password, the inputs the Operation will need is sAMAccountName of AD User, which will be passed from the skill attribute to the workflow. Input is an object that consists of all input fields and you can use it by typing
- In the above step you configured one operation. Similarly, you can create multiple operations within the same workflow.
- Define the sequence of your automation workflow by connecting the Start, Stop points and the Operations.
Defining the Start Activity Data
This is a requirement only when you are creating a new Automation Workflow. (For OOTB workflows this is already completed.)- Go to the Start step and double-click to open Start. It consists of the JSON Schema and Input tabs. The JSON Schema tab contains the details of all the inputs that the workflow will need. It defines which input parameters are required (mandatory), which parameters are optional and what are the data-types (string, number etc) of each input parameter. The Input tab should contain a super set list of all the input parameters that the workflow will need.
- First go to the Input tab and add all Input Parameters that are required for the various operations in your workflow.
- For example in the sample workflow below there are two operations. Operation 1 has input parameters requestor and login_name. Operation 2 has input parameters requestor, and to. In that case a super set of all the input parameters must be defined under the Input tab of Start step as shown in the following screenshot. Manually enter the input parameters under the Service Input tab. Remember to write the parameters inside curly brackets {}. Multiple parameters are separated by a comma.
- After this click the i button on the top right corner.
- This will open a website in a new browser tab, to generate the JSON Schema. Under the Sample JSON Document area, copy and paste all your input parameters and click Generate Schema.
- The JSON data is generated in the section below, as seen below.
- Copy this Infered JSON Schema and paste it into the Workflow Designer - Start step >> JSON Schema tab.
- Click Next, then click Submit. This saves the Start Activity data. For a custom or newly created workflow, if this step is not completed, then the input parameters defined in Automation Workflow will not be mapped with parameters of the automation workflow.
- Go to the Start step and double-click to open Start. It consists of the JSON Schema and Input tabs. The JSON Schema tab contains the details of all the inputs that the workflow will need. It defines which input parameters are required (mandatory), which parameters are optional and what are the data-types (string, number etc) of each input parameter. The Input tab should contain a super set list of all the input parameters that the workflow will need.
- Click Publish to publish your Automation workflow.
Define the Inputs or Outputs for an Operation
- Pass inputs to the operation from the user or an earlier branch:
@{input.field_name}
: defines that input
object holds the user input fields
Example: @{input.login_name} indicates login_name is a user input
2. Use the output from an operation as input for another operation:
You can use the output from an operation as inputs for another operation.
Some of the output fields that can be used in the next activity are:
- exit-code
- user_message
- error (in case of failure of operation)
The syntax to use is:
@{activity_id.output['exit-code']}
: will print the exit code from the operation.
@{activity_id.output['user_message']}
: will print the user message from the operation.
@{activity_id.output['error']}
: will print the error from the operation where activity_id is the ID of the step whose output will be used.
Example:
Hence the syntax used for output will be:
@{disable_ad_user.output['exit-code']}
@{disable_ad_user.output['user_message']}
@{disable_ad_user.output['error']}
Step 3: Update the Service Configurations
In order to execute a workflow, the system will need some configurations such as how to connect to the system where the automated task will be executed. You can store these configurations under the Service Configurations.
- Click the Automation icon.
The Automation page appears. - Click the Service Configurations tab.
- Identify the appropriate Service Configuration you need to update. Refer to the table listed in Annexure I to understand which Service Configuration is related to which Operation.
- Click the Edit icon to edit the records.
- If you want to input an encrypted value in the configurations, use the Encryption Utility provided. Add the data in Text to Encrypt field and click Encrypt.
The Encrypted text appears in the field below. - Click Copy to copy the encrypted text to the clipboard.
- Paste it under appropriate tag on the left pane.
Click Save to save your Service Configuration.
Note
Note that the Service Configuration is internally linked to the appropriate Operation. Administrator does not need to relate or link them.
Step 4 : Publish Automation workflow as a Service
In order to consume the Workflow, you need to publish the workflow as a Service. Following are the steps to do that:
- On the Automation page, click the Workflow Services tab.
- Click New Workflow Service as shown below.
The Workflow Services page appears as shown below. - Select your Workflow from the list.
- Provide the Name to your workflow service.
- Provide the workflow Description.
- Select the Orchestration Server as default. The Orchestration server should be set to 'default' if you are using the SaaS version of Automation. If you have deployed the Automation server on-premise, then the details have to be specified here.
- Click Save & Next.
The Attributes tab appears. - Click Add Text Attribute to add the attribute information.
The Add Text Attribute pop-up window appears as shown below. - Specify the attribute Field ID.
- System automatically populates the Field ID as the attribute Name.
- You can choose whether a Placeholder is required for the attribute.
- Click Save to save the changes.
Step 5 : Add the Automation Service into Ticket Workflow
You can link your Automation Workflow Service to a skill so that the automation task gets executed.
Refer to the steps listed at Execute an Automation Service from a Ticket Workflow.
Annexure I: OOTB Operations and their corresponding Service Configurations
No. | Operation Name | Service Configurations | Input Name |
1 | Disable AD User | active_directory_configuration sa_default_configurations | Login Name |
2 | Add AD User to Group | active_directory_configuration sa_default_configurations | Login Name Group Name |
3 | Create AD User | active_directory_configuration sa_default_configurations | Login Name First Name Last Name Employee ID |
4 | Unlock AD User | active_directory_configuration sa_default_configurations | Login Name |
5 | Delete AD User | active_directory_configuration sa_default_configurations | Login Name |
6 | Reset AD User Password | active_directory_configuration sa_default_configurations | Login Name Mobile Number |
7 | Create AD Group | active_directory_configuration sa_default_configurations | Group Name Group Description sAMAccountName |
8 | Enable AD User | active_directory_configuration sa_default_configurations | Login Name |
9 | Check Linux file exists | linux_configuration sa_default_configurations | File Name Directory Path |
10 | Execute Shell Script | linux_configuration sa_default_configurations | Shell script file absolute path |
11 | Compare two files in Linux | linux_configuration sa_default_configurations | Absolute path of file one Absolute path of file two |
12 | Stop Windows Service | active_directory_configuration sa_default_configurations | Windows Service Name |
13 | Windows Service Status | active_directory_configuration sa_default_configurations | Windows Service Name |
14 | Start Windows Service | active_directory_configuration sa_default_configurations | Windows Service Name |
15 | Execute Power Shell | active_directory_configuration sa_default_configurations | Power Shell script absolute path |
16 | Create VMware Snapshot | vmware_configuration sa_default_configurations | VM Name New Snapshot Name New Snapshot Description |
17 | Clone VMware Instance | vmware_configuration sa_default_configurations | New VM Name Existing VM Name |
18 | Delete VM Single Snapshot | vmware_configuration sa_default_configurations | VM Name VM Snapshot Name |
19 | Revert Snapshot of VM Instance | vmware_configuration sa_default_configurations | VM Name VM Snapshot Name |
20 | Delete VM Instance | vmware_configuration sa_default_configurations | Existing VM Name |
21 | Stop VMware Instance | vmware_configuration sa_default_configurations | Existing VM Name |
22 | Start VMware Instance | vmware_configuration sa_default_configurations | Existing VM Name |
23 | ISM Service request update status | sa_default_configurations | Ticket Status |
24 | ISM Create Service Request | sa_default_configurations | Requestor For Name Parent Request ID Request Details Request Description Request Category Request Class Requestor Name |
25 | ISM add worklog | sa_default_configurations | Worklog Description |
26 | Send Twilio SMS | sms_and_email_configuration sa_default_configurations | Mobile Number Message |
Note
requestor input field is common for all workflows.
© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com