Source
id: business-processes
namespace: tutorial
description: Business Processes
inputs:
- id: request.name
type: STRING
defaults: Rick Astley
- id: request.start_date
type: DATE
defaults: 2024-07-01
- id: request.end_date
type: DATE
defaults: 2024-07-07
- id: slack_webhook_uri
type: URI
defaults: https://reqres.in/api/slack
tasks:
- id: send_approval_request
type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
url: "{{ inputs.slack_webhook_uri }}"
payload: >
{
"channel": "#vacation",
"text": "Validate holiday request for {{ inputs.request.name }}. To approve the request, click on the `Resume` button here http://localhost:8080/ui/executions/{{flow.namespace}}/{{flow.id}}/{{execution.id}}"
}
- id: wait_for_approval
type: io.kestra.plugin.core.flow.Pause
- id: process_request
type: io.kestra.plugin.core.http.Request
uri: https://reqres.in/api/products
method: POST
contentType: application/json
body: "{{ inputs.request }}"
About this blueprint
Getting Started Inputs Software Engineering API Notifications
This flow is a simple example of a business process automation use case for vacation approval.
The user first submits a vacation request using a form automatically created in the Kestra UI thanks to inputs. The flow then sends a Slack message to request approval for a vacation, waits for the approval, and then processes the request. The approval is as simple as clicking on the Resume
button in the Kestra UI.
The flow has three tasks: 1. The first task sends a Slack message to request approval for a vacation. 2. The second task pauses the execution to wait for the approval. 3. Once the execution is resumed, the third task processes the vacation request.