Introducing a new way to review your PRs.

Read the announcement

keephq / keep

The open-source AIOps and alert management platform

View on GitHub

22 documents · Updated Nov 23, 2026

docs / workflow-authoring-ui

Workflow authoring UI

The Workflow authoring UI lets engineers create, inspect, test, and update alert and incident automations. It turns a workflow definition into a visual graph with editable triggers, provider steps, actions, conditions, and inputs. It then sends the definition to the workflow API for validation, storage, and execution. See the Web application page for the wider UI shell and Alert operations UI for the alert-side workflows that can trigger an automation.

Workflow lifecycle

Workflow discovery

The workflow area starts with a searchable and filterable list of saved workflows. Engineers can start from a template, start with an empty workflow, or upload a YAML definition. The list also gives a short view of each workflow's latest run state and recent execution activity.

The list combines text search with CEL filters. CEL means Common Expression Language. Here it is used as a compact expression language for matching workflow metadata and list facets. The UI sends the combined query to the backend and resets the result page when the query changes.

References: keep-ui/…/page.tsx• L7-29 keep-ui/…/workflows.page.tsx• L9-35 keep-ui/…/existing-workflows-state.tsx• L46-126 keep-ui/…/useWorkflowsV2.ts• L20-74

Workflow authoring

The authoring surface supports both a visual builder and a YAML definition view. The visual builder is the main editing surface for a new or existing workflow. The YAML view provides a direct representation of the same definition, so engineers can switch between structured editing and source editing without creating a second workflow model.

The builder can also show an AI assistant beside the graph. A template or an imported file supplies the initial definition. A new workflow receives a generated identity until the backend creates its saved workflow record.

flowchart LR
    A[Template, empty workflow, or YAML] --> B[Workflow definition]
    B --> C[Visual graph]
    B --> D[YAML view]
    C --> E[Validation]
    D --> E
    E --> F[Create or update workflow]
    F --> G[Saved revision]

References: keep-ui/…/workflow-detail-page.tsx• L45-173 keep-ui/…/create-workflow-modal.tsx• L12-46 keep-ui/…/workflow-builder-widget.tsx• L17-163 keep-ui/…/workflow-builder.tsx• L34-169

Workflow model

Workflow entities

The UI treats a workflow as a named, versioned automation with a raw YAML definition and metadata used by the list and detail views. The definition describes when the workflow starts and what it does after the trigger. Provider information connects each step or action to an installed integration.

EntityPurpose
TriggerStarts a run from a manual request, alert, interval, or incident event.
StepReads or processes data through a provider.
ActionSends or changes data through a provider.
ConditionSelects a branch through an assertion or threshold check.
Foreach containerRepeats a nested step or action for a set of values.
InputSupplies run-specific values with a type, description, default, or required state.
ConstantStores reusable workflow values.
RevisionIdentifies the definition used by a saved version and by each execution.

The graph keeps triggers at the start and separates the main sequence from conditional branches and repeated work. Provider setup and variable checks are part of authoring because an incomplete provider or invalid value can prevent a workflow from running.

References: keep-ui/…/workflows.ts• L7-74 keep-ui/…/types.ts• L21-75 keep-ui/…/types.ts• L162-213 keep-ui/…/validate-definition.ts• L15-87

Graph widgets

The graph shows each workflow unit as a node and each transition as an edge. Nodes display the provider or trigger identity and expose a menu for node-level actions. Edges show branch labels when a condition splits the flow and provide the insertion point for a new unit.

The toolbox presents available triggers and provider capabilities. Its contents change with the selected node or edge. This prevents invalid placement, such as adding a trigger after the workflow start or nesting a condition inside a condition. Selecting a node opens the matching editor for its properties.

References: keep-ui/…/ReactFlowBuilder.tsx• L13-112 keep-ui/…/WorkflowNode.tsx• L89-226 keep-ui/…/WorkflowEdge.tsx• L52-175 keep-ui/…/WorkflowToolbox.tsx• L147-265

Property editors

The side editor changes its fields to match the selected workflow part. Workflow settings cover metadata and reusable constants. Trigger editors cover trigger-specific settings. Step and action editors cover the provider connection, provider parameters, workflow name, and a step-level test view. Condition editors cover branch rules, and repeated-work editors cover the nested sequence.

Provider availability affects the authoring path. A provider that needs setup can be installed from the editor. A provider that is not installed remains a validation problem and blocks the actions that require a deployable workflow.

References: keep-ui/…/ReactFlowEditor.tsx• L13-91 keep-ui/…/WorkflowEditor.tsx• L8-167 keep-ui/…/TriggerEditor.tsx• L19-255 keep-ui/…/StepEditor.tsx• L133-207 keep-ui/…/StepEditor.tsx• L733-959

CEL input

Alert trigger expressions

An alert trigger can use CEL to decide which alerts start a workflow. The editor provides a Monaco-based CEL input with field suggestions from alert data. The expression is stored with the alert trigger and shown in the trigger description, while a nearby count helps the user see how many past alerts match the expression.

Legacy alert key-value filters remain visible for older definitions. The UI marks them as deprecated and directs new authoring toward CEL because the expression is the preferred stable filter contract.

References: keep-ui/…/TriggerEditor.tsx• L46-195 keep-ui/…/cel-input.tsx• L8-75 keep-ui/…/yaml.schema.ts• L77-106 keep-ui/…/getTriggerDescription.ts• L35-60

Workflow list filters

The workflow list uses the same CEL concept for metadata search and facet filters. Text entered in the search box becomes a name-or-description expression. Facet choices are combined with that expression before the request is sent, so the list and its pagination represent one server-side query.

References: keep-ui/…/existing-workflows-state.tsx• L58-95 keep-ui/…/existing-workflows-state.tsx• L128-180 keep-ui/…/useWorkflowsV2.ts• L34-67

Validation and save state

Definition validation

Validation protects the contract between the authoring UI and the workflow engine. It checks workflow-level requirements such as metadata, at least one trigger, and at least one step or action. It also checks provider setup and values that must resolve before execution.

The status panel groups the result into three user-facing states: valid and deployable, saveable but not runnable, or blocked from saving. Errors can point back to the related node or insertion edge so the engineer can correct the definition in context.

References: keep-ui/…/validate-definition.ts• L15-126 keep-ui/…/validate-definition.ts• L128-220 keep-ui/…/workflow-status.tsx• L43-117

Save and revision state

Edits first update the in-memory workflow definition. The builder tracks whether graph nodes and property fields are synchronized, whether the definition can deploy, and whether unsaved changes exist. The Save action is enabled only when the definition is synchronized and valid for saving.

Creating a workflow sends the definition to the create API and then opens the new workflow record. Updating sends the same definition to the workflow-specific update API. A successful create or update produces a revision, and the UI refreshes the workflow data so later runs and views use the saved state.

References: keep-ui/…/types.ts• L181-271 keep-ui/…/workflow-builder.tsx• L172-229 keep-ui/…/workflow-builder-widget.tsx• L32-155 keep-ui/…/useWorkflowActions.ts• L14-142

Workflow execution

Manual and test runs

A manual run executes a saved workflow. The workflow detail run flow checks for unsaved changes, collects declared workflow inputs, and asks for alert or incident context when the workflow depends on it. It sends the collected data to the run endpoint, which returns an execution ID and opens that execution.

The alert and incident run modal also supports starting a run from an event context. It can receive a workflow directly or let the engineer choose from workflows that the current user can run. The modal reads declared inputs from the workflow YAML, fills defaults, blocks the Run action until effectively required values are present, and sends the event body and inputs to the workflow run endpoint. A successful direct run shows a link to the execution view.

A test run uses the current definition instead of requiring a saved revision. It sends the definition to the test endpoint and uses a synthetic or user-supplied event context. This lets an engineer test a new or edited graph before committing it to the saved workflow.

sequenceDiagram
    participant E as Engineer
    participant U as Authoring UI
    participant A as Workflow API
    participant R as Execution view
    E->>U: Select Run or Test run
    U->>U: Save or confirm unsaved changes
    U->>U: Collect inputs and event context
    U->>A: Submit workflow run request
    A-->>U: Return execution ID
    U->>R: Open execution view
    R->>A: Poll status, logs, results, and revision

References: keep-ui/…/useWorkflowRun.ts• L28-203 keep-ui/…/useWorkflowRun.ts• L214-345 keep-ui/…/manual-run-workflow-modal.tsx• L87-224 keep-ui/…/manual-run-workflow-modal.tsx• L238-325 keep-ui/…/useWorkflowTestRun.ts• L8-47 keep/…/workflows.py• L357-451 keep/…/workflows.py• L486-579

Workflow inputs

Declared inputs turn a workflow run into a guided form instead of a request with hidden assumptions. The form supports string, number, boolean, and choice values. Defaults fill the initial state. A required input or an input without a default must have a value before the run can continue.

The manual-run modal uses the selected workflow's YAML definition to build this form. It keeps the input state with the selected workflow and clears that state when the modal closes, so a later run does not reuse values from an earlier run.

References: keep-ui/…/WorkflowInputFields.tsx• L9-201 keep-ui/…/WorkflowInputsForm.tsx• L6-80 keep-ui/…/manual-run-workflow-modal.tsx• L114-171 keep-ui/…/manual-run-workflow-modal.tsx• L288-325 keep-ui/…/useWorkflowRun.ts• L66-72 keep-ui/…/useWorkflowRun.ts• L267-278

Execution-result views

Workflow overview

The overview connects the saved workflow to its operational history. It shows total runs, pass and fail counts, success rate, average duration, the provider path, an execution graph, and a paginated execution table. Each table row identifies the workflow revision and the trigger source, so an engineer can distinguish current behavior from an older run.

References: keep-ui/…/workflow-overview.tsx• L26-163 keep-ui/…/workflow-executions-table.tsx• L99-275 keep/…/workflows.py• L977-1073

Execution detail

The execution detail view explains one run from both sides. The left side groups logs by step or action and shows status, duration, messages, and step output. The right side shows the exact workflow definition used by the run, marked as current or as a historical revision. When the backend records the triggering event, the view adds a read-only event tab.

Runs in progress refresh until their status changes, then stop after a short delay so final logs can arrive. A failed run shows the backend error and can offer a cURL replay for alert or incident event context.

References: keep-ui/…/WorkflowExecutionResults.tsx• L49-161 keep-ui/…/WorkflowExecutionResults.tsx• L166-321 keep-ui/…/WorkflowExecutionResults.tsx• L335-416 keep-ui/…/WorkflowExecutionLogs.tsx• L121-198 keep-ui/…/WorkflowExecutionLogs.tsx• L211-298 keep-ui/…/WorkflowExecutionError.tsx• L11-73

Backend workflow API

Workflow records

The workflow API is the boundary between the authoring surface and the saved automation. The UI reads a workflow by ID, receives its metadata, provider information, triggers, raw definition, disabled state, and current revision, then uses that data to initialize the builder and detail views.

The API accepts YAML content for both file upload and builder save flows. A create request uses the workflow definition to create a record. An update request replaces the saved definition and returns the new revision. The API does not allow updates to provisioned workflows, so the UI must treat a successful response as the source of the saved state rather than assuming every edit can be stored.

References: keep-ui/…/workflows.ts• L53-74 keep-ui/…/workflows.ts• L144-171 keep-ui/…/useWorkflowDetail.ts• L6-31 keep-ui/…/useWorkflowActions.ts• L39-142 keep/…/workflows.py• L611-716 keep/…/workflows.py• L795-855

Run and history endpoints

The API separates a saved workflow from its executions. A run request accepts event context and workflow inputs, checks execution permission, and returns an execution ID. A test request accepts the current raw definition and returns an execution ID without first saving that definition as the user's workflow.

The UI uses the execution list endpoint for counts, duration summaries, revision labels, trigger details, and paginated history. It uses the execution detail endpoint for the full status, logs, results, error, event identifiers, and revision-specific definition needed by the result view.

References: keep/…/workflows.py• L357-451 keep/…/workflows.py• L486-579 keep/…/workflows.py• L977-1073 keep/…/workflows.py• L1089-1129 keep-ui/…/useWorkflowExecutionsV2.ts• L7-46 keep-ui/…/useWorkflowExecutionDetail.ts• L9-29

API access boundary

The shared API client adds the session token to requests and blocks modification requests when the application is in read-only mode. Workflow reads remain available through the normal read paths, while create, update, delete, and run requests require the matching backend permission and a writable application state.

References: keep-ui/…/ApiClient.ts• L11-19 keep-ui/…/ApiClient.ts• L38-55 keep-ui/…/ApiClient.ts• L72-114 keep-ui/…/ApiClient.ts• L135-192

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the visual definition, YAML conversion, and validation rules aligned. A field that is accepted in one representation but lost in another can produce a workflow that looks saved but runs differently.
  • Preserve the revision link between an execution and its definition. Result views must load the execution's revision rather than always showing the latest workflow.
  • Keep trigger and dependency detection aligned with manual-run and test-run payloads. A new input or event dependency must be collected before either endpoint is called.
  • Keep provider metadata, installed-provider state, and deploy validation aligned. The builder uses all three to decide whether a workflow can be saved or run.
  • Preserve the API response fields used by list summaries and execution views, including execution IDs, revision numbers, status, logs, results, and trigger context.
  • Keep the manual-run workflow selector's eligibility rules aligned with the canRun contract. Keep custom selector components stable so polling or workflow revalidation does not close an open menu.

Important failure modes

TriggerConsequenceGuard
The workflow has no trigger or no step/action.The definition cannot be saved or run.Global validation reports the missing graph entry.
A required provider is not installed or selected.The workflow cannot run through the builder.Provider validation marks the step and the run control is disabled.
The builder or YAML editor has unsaved changes when Run is selected.The run may use an older saved definition.The run flow asks the engineer to save or continue without saving.
No enabled workflow is runnable by the current user.The event run modal cannot start a workflow.The selector filters to runnable workflows and shows an empty state when none remain.
A workflow input has no value.The backend receives an incomplete run payload.The input form marks the field and blocks form submission.
An execution detail request returns a failure object or no workflow revision.The result view cannot show the normal definition and step results.The view shows an execution error and a revision-specific load error.
A write request runs while the application is read-only or the workflow is provisioned.The API rejects the modification.The shared API client and backend return a read-only or forbidden error.

Key files

FileWhy to read it
keep-ui/…/workflow-detail-page.tsxShows how overview, builder, YAML, versions, and secrets form the workflow detail surface.
keep-ui/…/workflow-builder.tsxConnects the visual builder, YAML view, in-memory definition, validation, and save flow.
keep-ui/…/ReactFlowBuilder.tsxShows the graph entry point and the relationship between nodes, edges, and the side editor.
keep-ui/…/WorkflowToolbox.tsxShows how available triggers and workflow units are selected and inserted.
keep-ui/…/TriggerEditor.tsxShows trigger settings and alert CEL input.
keep-ui/…/workflow-store.tsShows the shared authoring state that links graph edits to the workflow definition.
keep-ui/…/validate-definition.tsShows the rules that decide whether a workflow can be saved or run.
keep-ui/…/useWorkflowActions.tsShows the UI contract for create, update, upload, and delete requests.
keep-ui/…/manual-run-workflow-modal.tsxShows event-context runs, runnable workflow selection, and input collection before a direct run request.
keep-ui/…/manual-run-workflow-modal.test.tsxShows the guard against selector remounts during page re-renders.
keep-ui/…/WorkflowExecutionResults.tsxShows how one execution combines live status, logs, results, event data, and the used revision.
keep/…/workflows.pyShows the backend boundary for workflow records, runs, test runs, versions, and execution history.