Using Slack with ProcessMaker I/O
If you would like to see the "Leave Absence Request Use Case in Slack" in action, click this video below.
This use case demonstrates how to use ProcessMaker I/O in combination with Slack. Both software programs provide the tools to build effective processes while satisfying a variety of business needs. One of the added benefits of using ProcessMaker I/O with Slack is the ability to work directly from the Slack bot interface. The user only needs to work in one window rather than switching between windows.
*ProcessMaker I/O is an "always on" cloud service. In this document an Environment refers to an installation of ProcessMaker I/O in a virtual machine or a container. This environment is created, run, and managed directly through the ProcessMaker I/O web management console.
If you don't have a ProcessMaker I/O Environment yet, do the following:
If you already have a ProcessMaker I/O Environment, do the following:
Configure a Slack bot to do the following:
Follow these steps to configure your Slack bot:
The steps described above are not required, but are useful to modify communication between Slack and your ProcessMaker I/O Environment. To follow along with our example, it is necessary to do these steps as instructed.
In the "Initiate SlackBot" service task, define the channel name in the DataModel 'channel_name' variable. For example: $aData['channel_name']='#testprocess';
Your channel can be private. Create the appropriate permissions in Slack in advance.
The following connectors integrate with Slack services.
This connector sets up and configures communication between Slack Interactive Messages and your process. Juliya Zagoruyko (Unlicensed): Is there no more information about this connector–parameter descriptions and such?
This connector implements integration between your process and the Slack Web API. Juliya Zagoruyko (Unlicensed): Is there no more information about this connector–parameter descriptions and such?
This use case provides absence requests and approval actions via Slack bot.
Workflow for this use case is as follows:
The graphic below shows the BPMN process scheme.
Each process lane in this process is briefly described below.
Process Lane Name | Description |
Requester | A user initiates the process by requesting absence. |
Approver | A user or group of users who have permission to approve a leave of absence. |
Slack Action Receiver | The technical process for receiving and processing button responses from Slack. |
Tasks in this process are described below in the order they appear in the process scheme from left to right, top to bottom.
Task | Type | Process | Connector | Description |
Time Off Request | start event | Requester | Starts the Requester process. | |
Initiate SlackBot | script task | Requester | This technical task runs script and sets up the Slack application parameters, such as AppNumber, Dates, Slack bot token and Slack channel name. | |
Send Time Off Request | service task | Requester | Slack\APIConnector | This is where the user requests the time off. |
Slack Request Sent | intermediate message event | Requester | This message event sends the request for approval. | |
Approve Request | start message event | Approver | This start event is initiated by the Slack Request Sent message event and launches the approver process. | |
Slack Response Received | start event | Slack Action | This event launches the Slack API when the "Approve" or "Reject" button is clicked. | |
Parse Payload | script task | Slack Action | This script decodes JSON and prepares the data to send in the Slack API response to the approver. | |
Get Slack Callback | intermediate message event | Slack Action | CorrelationKeys | Gets the callback and sends the Slack response to the appropriate process instance. |
Response Confirmation | service task | Slack Action | Slack\SendMessageConnector | This connector sends the Slack WebHook. |
Get Slack Response | intermediate message event | Approver | When the approver gets the response from the Slack webhook, the approver can continue with the approval process. | |
Send Approval/Send Decline | service task | Approver | Slack\APIConnector | This is where the approver makes a decision. |
Send Confirmation Request Accepted | Service Task | Requester | Slack\SendMessageConnector | This is where the requester gets a message notifying them that their request is being reviewed. |
Decision Made | intermediate message event | Requester | CorrelationKeys | This message event sends a notification to the requester with the approver's decision. |
Since there are no forms because everything is accessed through Slack, we only need to define the fields that will house the data for each case.
Field ID | Field Label | User Filled | Field Type | Field Description |
RequesterUsername | Requester Username | N | String | The requester's username |
RequestorFullname | Requester Full Name | N | String | The full name of the requester |
RequestDate | Request Date | N | Datetime | Date of the request |
TimeOffDateStart | Time Off Start | Y | Datetime | Date the time off will start |
TimeOffDateEnd | Time Off End | Y | Datetime | Date the time off will end |
ReasonForTimeOff | Reason For Taking Time Off | Y | String | The reason why the requester is requesting time off |
Status | Status | N | String | The current status of the request. Options are: |
All messages will take place in Slack. There will be NO email messages, as that defeats the purpose of Slack. Therefore, all messages will be in the form of formatted webhook messages in either a channel or a private message between the ProcessMaker Bot and the user.
Message Title | Task | Location | Content |
Notification to approver | Approve Time Off | Channel | Hello |
Approval notification to requestor | Approve Time Off | Private Message | Hello |
Rejection notification to requestor | Approve Time Off | Private Message | Hello |
New case note | All | Private Message | Hello |