Back to Kibana

Workflows Management Plugin

src/platform/plugins/shared/workflows_management/README.md

9.4.014.0 KB
Original Source

Workflows Management Plugin

This plugin contains the Workflows management application and APIs.

The workflows management plugin provides the user interface and management capabilities for creating, editing, scheduling, and monitoring workflows. It serves as the primary interface for workflow operations and integrates with the workflows execution engine.


Table of Contents


Requirements

To use workflows, you need an active Enterprise license. Workflows are not available on Basic or Standard licenses.


The Feature Flag

The workflows feature UI setting is enabled by default, it can be disabled via Kibana config with:

yml
uiSettings.overrides:
  workflows:ui:enabled: false

If running in Serverless or Cloud dev environments, you can disable it via API:

bash
POST kbn://internal/kibana/settings
{
   "changes": {
      "workflows:ui:enabled": false
   }
}

Overview

The workflows management plugin provides:

  • Workflow Designer: Visual interface for creating and editing workflows
  • Workflow Library: Browse and manage existing workflows
  • Execution Monitoring: Track workflow runs and performance
  • Scheduling: Configure automated workflow execution
  • Connector Integration: Manage workflow connectors and actions

Features

Workflow Creation

  • Drag-and-drop workflow designer
  • Step configuration and validation
  • Variable and context management
  • Template support
  • YAML-based workflow definition

Workflow Management

  • Workflow versioning and history
  • Import/export capabilities
  • Workflow cloning
  • Bulk operations

Execution & Monitoring

  • Real-time execution tracking
  • Execution history and logs
  • Performance metrics
  • Error handling and debugging
  • Step-level execution details

Testing & Validation

  • Workflow validation before execution
  • Test individual steps
  • Test complete workflows without saving
  • JSON schema validation

Architecture

The management plugin follows a layered architecture:

┌─────────────────────────────────────────┐
│          Public UI Layer                │
│  (React components, forms, visualizer)  │
└─────────────────────────────────────────┘
                  ↓
┌─────────────────────────────────────────┐
│         Server API Layer                │
│      (REST endpoints, validation)       │
└─────────────────────────────────────────┘
                  ↓
┌─────────────────────────────────────────┐
│       Service Layer                     │
│  (Business logic, workflow management)  │
└─────────────────────────────────────────┘
                  ↓
┌─────────────────────────────────────────┐
│    Storage & Execution Layer            │
│ (Saved Objects, Task Manager, Engine)   │
└─────────────────────────────────────────┘

Key Components

  • Workflows Management Service: Core service for workflow CRUD operations and execution management
  • Workflows API: RESTful API endpoints for all workflow operations
  • Saved Objects: Workflow definitions persisted as Kibana saved objects
  • Task Manager Integration: Handles scheduled workflow execution
  • Connector Integration: Interfaces with Kibana Actions framework

Dependencies

Required Plugins

PluginPurpose
workflowsExecutionEngineCore execution runtime for workflows
taskManagerScheduled execution management
actionsConnector and action support
featuresFeature registration and capabilities
securityAccess control and authentication
triggersActionsUiAction configuration UI
spacesMulti-tenancy support
navigationUI navigation
data, dataViewsData layer and index patterns
esUiSharedShared Elasticsearch UI components
stackConnectorsBuilt-in connector types
fieldFormatsField formatting utilities
unifiedSearchSearch capabilities
embeddableWorkflow visualization

Optional Plugins

PluginPurpose
alertingIntegration with alerting framework
serverlessServerless-specific features

API versioning, compatibility, and stability

This section summarizes how public Workflows HTTP APIs are versioned and how that appears in documentation. For authoritative paths, parameters, and examples, use the generated OpenAPI surface.

Version compatibility

TopicDetail
API date versionPublic routes use version 2023-10-31 (see API_VERSION in server/api/routes/utils/route_constants.ts).
Version headerSend elastic-api-version: 2023-10-31 on requests to public endpoints, consistent with Kibana HTTP API versioning.
Stack introductionPublic Workflows REST APIs are annotated with since: 9.4.0 for stack deployments.
LicenseAn Enterprise license is required (see Requirements).
PrivilegesAccess is enforced via workflowsManagement feature privileges (see route security blocks under server/api/routes/).
UI setting workflows:ui:enabledControls whether the Workflows management application and related UI are registered in the browser. It does not remove public REST routes under /api/workflows; those routes remain subject to license and authorization checks.
SpacesPublic URLs are space-aware (for example /s/{space_id}/api/workflows in documentation); see Spaces.

API Endpoints

Public HTTP APIs live under /api/workflows (space-aware in docs as /s/{space_id}/api/workflows/...). Send elastic-api-version: 2023-10-31 on requests.

OpenAPI (OAS) documentation for these endpoints: use the generated bundles—kibana.yaml (stateful) and kibana.serverless.yaml (serverless)—or the published Workflows API group (stateful) and Workflows API group (serverless). Each public operation lists parameters, request bodies, responses, and examples.

Public routes

MethodPathSummary
GET/api/workflowsList workflows (pagination and filters via query string).
POST/api/workflowsBulk create workflows.
DELETE/api/workflowsBulk delete workflows.
POST/api/workflows/mgetGet multiple workflows by ID.
POST/api/workflows/exportExport workflows.
GET/api/workflows/statsWorkflow statistics.
GET/api/workflows/aggsWorkflow aggregations.
GET/api/workflows/connectorsAvailable connector types.
GET/api/workflows/schemaWorkflow JSON schema.
POST/api/workflows/workflowCreate a workflow.
GET/api/workflows/workflow/{id}Get a workflow by ID.
PUT/api/workflows/workflow/{id}Update a workflow.
DELETE/api/workflows/workflow/{id}Delete a workflow.
POST/api/workflows/workflow/{id}/cloneClone a workflow.
POST/api/workflows/workflow/{id}/runRun a workflow.
GET/api/workflows/workflow/{workflowId}/executionsList executions for a workflow.
GET/api/workflows/workflow/{workflowId}/executions/stepsList step executions for a workflow.
POST/api/workflows/workflow/{workflowId}/executions/cancelCancel all active executions for a workflow.
POST/api/workflows/testTest a workflow without persisting it.
POST/api/workflows/step/testTest a single workflow step.
GET/api/workflows/executions/{executionId}Get an execution by ID.
GET/api/workflows/executions/{executionId}/childrenList child executions.
GET/api/workflows/executions/{executionId}/logsExecution logs.
GET/api/workflows/executions/{executionId}/step/{stepExecutionId}Get a step execution.
POST/api/workflows/executions/{executionId}/cancelCancel an execution.
POST/api/workflows/executions/{executionId}/resumeResume an execution.
GET/api/workflows/executions/{executionId}/trigger_event_traceTrigger event trace for an execution.

Internal routes

These routes use access: internal and are not included in the public OpenAPI bundles above. They use a numeric elastic-api-version (see INTERNAL_API_VERSION in server/api/routes/utils/route_constants.ts). For validate, example payloads live in validate_workflow.yaml.

MethodPathPurpose
GET/internal/workflows/configExecution engine feature flags for the plugin.
POST/internal/workflows/disableDisable all workflows (administrative).
POST/api/workflows/validateValidate a workflow YAML definition without saving.

UI Application

The workflows management UI is available at /app/workflows when the feature flag is enabled.

Features

  • Workflow Designer: Visual workflow builder with drag-and-drop interface
  • Workflow Library: Browse, search, and filter workflows
  • Execution Dashboard: Monitor workflow executions in real-time
  • Execution History: View past executions with filtering and sorting
  • Step-by-step Debugging: Detailed step execution information
  • Connector Management: View and configure available connectors

Routes

  • /app/workflows - Workflow library (home page)
  • /app/workflows/new - Create new workflow
  • /app/workflows/edit/{id} - Edit existing workflow
  • /app/workflows/{id} - View workflow details
  • /app/workflows/{id}/executions - View workflow execution history
  • /app/workflows/executions/{executionId} - View execution details

Pagination (HTTP APIs)

Many list endpoints accept page and size (or route-specific defaults) as query parameters on GET requests. Exact fields and response envelopes differ by route—use the OpenAPI entries for each operation.

Examples (add elastic-api-version: 2023-10-31 and auth headers as for any public Kibana API):

List workflows (free-text query plus pagination):

http
GET /api/workflows?page=1&size=20&query=sales

List executions for a workflow:

http
GET /api/workflows/workflow/{workflowId}/executions?page=1&size=20

Execution logs (see the workflows OpenAPI operation for required vs optional query fields such as size, page, and stepExecutionId):

http
GET /api/workflows/executions/{executionId}/logs

Development

Plugin Structure

workflows_management/
├── common/              # Shared code (types, schemas, utilities)
├── public/              # Browser-side code
│   ├── application.tsx  # Main application entry
│   ├── components/      # React components
│   ├── features/        # Feature modules
│   ├── pages/          # Page components
│   └── ...
├── server/             # Server-side code
│   ├── workflows_management/  # Core service and API
│   │   ├── routes/           # API route handlers
│   │   └── ...
│   ├── storage/        # Data persistence layer
│   ├── tasks/          # Task manager integration
│   └── ...
└── README.md          # This file

Local Development

  1. Enable the feature flag in kibana.dev.yml
  2. Start Elasticsearch: yarn es snapshot
  3. Start Kibana: yarn start
  4. Navigate to /app/workflows

Testing

bash
# Run unit tests
yarn test:jest src/platform/plugins/shared/workflows_management
# Running a specific test
yarn test:jest -- $path # (e.g. src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/snippets/insert_trigger_snippet.test.ts)

# Run integration tests
yarn test:jest_integration src/platform/plugins/shared/workflows_management

# Run FTR tests (if available)
yarn test:ftr --config x-pack/test/workflows_management_api_integration/config.ts

Authentication & Authorization

All API endpoints require authentication. The plugin integrates with Kibana's security framework:

  • Read operations: Require read privilege on workflows
  • Write operations: Require write privilege on workflows
  • Execute operations: Require execute privilege on workflows
  • Delete operations: Require delete privilege on workflows

Workflows are space-aware and respect Kibana Spaces boundaries.


Additional Resources


Plugin Owner: @elastic/workflows-eng