Actions
This section will describe the group of action types available to be set in the Automation Workflow.
Start
The Start action must be the first action set in the Automation Workflow.
Without this action, the Automation Workflow will not be saved nor started, since this is the action that indicates that the workflow should begin.
When this action is triggered, the payload will be loaded into the "{{['#HttpRequest']$.Body}}"
.
Configurations
To configure this action, the fields required to be filled are:
- actionType - Set as "Start"
- name
- next
{
"actionType": "Start",
"name": "Starting",
"next": "GetJobBrief"
},
Template Description
- actionType – The type of action that will be triggered
- name - The name of the action
- next - The action that will be triggered after the current action been completed
Result
The Result action is the action responsible to finish the Automation Workflow.
Once the Result action is triggered, it will end the automation workflow.
It is also possible to return a custom response, by managing the action httpResponse field.
Configuration
The default Result action does not require any additional field other than actionType and the name.
To have a custom Response you must configure the httpResponse.
- httpResponse
- statusCode
- headers
- body
{
"actionType": "Result",
"name": "Exit",
"httpResponse": {
"statusCode": 200,
"headers": {
"content-type": "application/json"
},
"body": "{{['SendExpenseFile']}}"
}
},
Template Description
- actionType - The action type is Result
- name - The action name is custom
- httpResponse - Optional
- statusCode - The value to be sent in the HttpResponse statusCode
- headers - The headers to be sent in the HttpResponse headers
- body - The body to be sent in the HttpResponse body
Rest
The Rest action allows doing Rest calls by setting in the Method parameter:
- GET
- POST
- PUT
- PATCH
- DELETE
Configuration
To configure this action, the fields available are:
- actionType - Rest
- Method - GET/POST/PUT/PATCH/DELETE
- bodyMediaType - Json/Raw/UrlEncodedFormData/MultipartFormData/File
- url
- body
- requestHeaders - Key-Value array -
[{"name": "","value": ""}]
- bodyFormData
- IsApiCall - Default False
- EnsureSuccessStatusCode - Default False
- responseHeaders - Array -
["date","x-api-version"]
{
"actionType": "Rest",
"name": "",
"next": "",
"Method": "GET/POST/PUT/PATCH/DELETE",
"bodyMediaType": "Json/Raw/UrlEncodedFormData/MultipartFormData/File",
"url": "",
"body": "",
"isApiCall":true,
"ensureSuccessStatusCode":false,
"requestHeaders": [
{
"name": "",
"value": ""
}
],
"bodyFormData": [],
"responseHeaders":[]
},
Template Description
- actionType – The actionType must be Rest for Rest actions
- name - The name of the action
- next - The action that will be triggered after the current action been completed
- Method - Should be set according to the method to be applied
- url - The URL to be called
- isApiCall - If set, will append tenant Api Authority to request and add authentication Headers. Defaults to
true
- ensureSuccessStatusCode - If set, ensures that the response is a success Status Code (200 - 299). If not will throw an error and stop execution. Defaults to
False
- responseHeaders - If set, returns the response will bring the headers values for the keys defined.
- bodyMediaType - Allows you to manage the Request headers and body.
- Please see on the tabs below the bodyMediaType available:
- JSON
- Raw
- Url Encoded Form Data
- File
By setting the bodyMediaType as Json, it will automatically assume:
- Body Media Type - "Json"
- Content-Type - Set by default as "application/json"
- Body - The request body should be set in JSON format and escaped
{
"bodyMediaType": "Json",
"body": "{\"parameter\":\"value\"}"
}
By setting the bodyMediaType as Raw:
- Body Media Type - "Raw"
- Content-Type - It is required to set it manually by passing the requestHeaders
- Request Headers - Use this field to manually set the request headers
{
"bodyMediaType":"Raw",
"body":"{\"parameter\":\"value\"}",
"requestHeaders": [
{
"name":"Content-Type",
"value":"application/json-patch+json"
},
{
"name":"Authorization",
"value":"Bearer {Token}"
}
]
},
By setting the bodyMediaType as UrlEncodedFormData:
- Content-Type - Set by default as "application/x-www-form-urlencoded"
- bodyFormData - The request body should be sent in the bodyFormData parameter as an Array of Key -
Values:
[{"key":"value"}]
{
"bodyMediaType":"UrlEncodedFormData",
"bodyFormData": [
{
"key": "grant_type",
"value": "client_credentials"
},
{
"key": "client_id",
"value": "fb3ccf6c-b672-45af-8389-51bfba06"
},
{
"key": "client_secret",
"value": "5eKItuYeV3iZ1mxY8ktNWYY1bbKOgTO+POIR123/g="
}
]
},
By setting the bodyMediaType as File:
- The file action allows you to add to the Content a StreamContent
- The file's content will be sent as a sequence of bytes
- Body - The body parameter must contain the file content
- You can combine the Download action to obtain a file content from any URL
[
{
"actionType": "Download",
"name": "DownloadFile",
"next": "UploadFile",
"url": "{{['GetProjectFile']$.Content.Uri}}"
},
{
"actionType": "Rest",
"name": "UploadFile",
"next": "Exit",
"Method": "Post",
"url": "https://skillsworkflow.com/sites/Coca-Cola/_api/UploadFile?name=Summer Campaign 2019",
"body": "{{['DownloadFile']$.Content}}",
"bodyMediaType": "File",
"RequestHeaders": [
{
"name": "Accept",
"value": "application/json; odata=verbose"
},
{
"name": "Authorization",
"value": "Bearer {Token}"
}
]
}
]
Sftp
There are actions available to do actions related to SFTP:
- SftpListFiles - Returns a list of files
- SftpDownload - Download files
- SftpUpload - Upload files
- SftpMoveTo - Move files between folders
Configuration
There are configurations that need to be applied in the automation workflow in order to perform the actions properly.
Please check the template description to know which parameters must be sent for each action.
{
"actionType": "SftpListFiles" or "SftpDownload" or"SftpUpload" or "SftpMoveTo",
"name": "SftpListFiles",
"next": "Exit",
"ftpHostIp": "sftp.skillsworkflow.com",
"ftpUsername": "SkillsWorkflow",
"ftpPassword": "*",
"ftpPrivateKeyFile": "PrivateKeyFile"
"ftpPath":"",
"ftpToPath":"",
"filePath": "",
"fileNameContains": "",
"fileNameEndsWith": "",
"fileName": "",
"fileType": "Csv"
},
Template Description
- Sftp List Files
- Sftp Download
- Sftp Upload
- Sftp Move To
{
"actionType": "SftpListFiles",
"name": "SftpListFiles",
"next": "Loop",
"ftpHostIp": "sftp.skillsworkflow.com",
"ftpUsername": "SkillsWorkflow.Sftp.QA",
"ftpPassword": "",
"filePath": "/path",
"fileNameContains": "",
"fileNameEndsWith": ""
},
- actionType – The action type must be one of the following: SftpListFiles,
- name - The name of the action
- next - The action that will be triggered after the current action been completed
- ftpHostIp – The host to be connected (ex: IP address or URL)
- ftpUsername – The username that will be used to connect to the SFTP
- ftpPassword – The user's password that will be used to connect to the SFTP
- ftpPath - It is used to identify the directory where the file should be searched
- fileNameContains – The action will filter the list of files by only showing the files that contain this parameter value
- fileNameEndsWith – The action will filter the list of files by only showing the files that end with this parameter value
{
"actionType": "SftpDownload",
"name": "SftpDownload",
"next": "ReadFileData",
"ftpHostIp": "sftp.skillsworkflow.com",
"ftpUsername": "SkillsWorkflow.Sftp.QA",
"ftpPassword": "",
"ftpPath": "/path",
"fileName": "{{['#ImportFile']}}"
},
- actionType – The action type must be one of the following: SftpDownload,
- name - The name of the action
- next - The action that will be triggered after the current action been completed
- ftpHostIp – The host to be connected (ex: IP address or URL)
- ftpUsername – The username that will be used to connect to the SFTP
- ftpPassword – The user's password that will be used to connect to the SFTP
- ftpPath - It is used to identify in which directory is the file
- fileName - The file name that will be downloaded
{
"actionType": "SftpUpload",
"name": "SftpUpload",
"next": "Exit",
"ftpHostIp": "sftp.skillsworkflow.com",
"ftpUsername": "SkillsWorkflow.Sftp.QA",
"ftpPassword": "",
"ftpPath": "/path",
"filePath": "C:\\TempFolder\test.png",
"fileName": "NewFilename.csv"
},
-
actionType – The action type must be one of the following: SftpUpload
-
name - The name of the action
-
next - The action that will be triggered after the current action been completed
-
ftpHostIp – The host to be connected (ex: IP address or URL)
-
ftpUsername – The username that will be used to connect to the SFTP
-
ftpPassword – The user's password that will be used to connect to the SFTP
-
ftpPath - It is used to identify the directory where the file should be placed
-
filePath
-
It is used to identify the full path of the file in case it is in a temp folder (Download action result)
-
The value must have the whole path including the filename and extension
- e.g. "C:\Folder\test.png"
- fileName - The name that the file will have when uploaded into the SFTP including the file extension
{
"actionType": "SftpMoveTo",
"name": "MoveSftpFileSuccess",
"next": "Exit",
"ftpHostIp": "sftp.skillsworkflow.com",
"ftpUsername": "SkillsWorkflow.Sftp.QA",
"ftpPassword": "*",
"ftpPath": "/path",
"ftpToPath": "/toPath",
"fileName": "{{['#ImportFile']}}"
},
- actionType – The action type must be one of the following: SftpMoveTo
- name - The name of the action
- next - The action that will be triggered after the current action been completed
- ftpHostIp – The host to be connected (ex: IP address or URL)
- ftpUsername – The username that will be used to connect to the SFTP
- ftpPassword – The user's password that will be used to connect to the SFTP
- ftpPath - It is used to identify the origin directory
- ftpToPath - It is used to identify the destination directory where the file should be placed
- fileName- The file name that will be moved between paths
E-mail
Email action allows you to send e-mails.
Configurations
To do so, it is required some parameters to be filled:
- body - The e-mail's body
- subject - The email's subject
- fromDisplayName - The display name that will appear on the sender
- toAddress - The email address to whom the email should be sent
{
"actionType": "Email",
"name": "SendEmail",
"next": "Exit",
"body": "This body can also be HTML.",
"subject": "This is the e-mail subject",
"fromDisplayName": "Notification | Skills Workflow",
"toAddress": "user@skillsworkflow.com",
"attachments": ["document.pdf"]
},
Template Description
- actionType – The action type is Email
- name - The name of the action
- next - The action that will be triggered after the current action been completed
- body - The body that should be sent in the e-mail's body. It also supports HTML
- subject - The email's subject
- fromDisplayName - The display name that will appear on the sender
- toAddress - The email address to whom the email should be sent
- attachment - Name of the File to attach in email