Blueprints

Getting started with Kestra — a Business Processes workflow example

About this blueprint

API Getting Started Inputs 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.
yaml
id: business_processes
namespace: tutorial

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:28080/ui/executions/{{flow.namespace}}/{{flow.id}}/{{execution.id}}"
      }

  - id: wait_for_approval
    type: io.kestra.core.tasks.flows.Pause

  - id: process_request
    type: io.kestra.plugin.fs.http.Request
    uri: https://reqres.in/api/products
    method: POST
    contentType: application/json
    body: "{{ inputs.request }}"

Slack Incoming Webhook

Pause

Request

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra