Skip to content

[One workflow] Instrument event-driven execute modal telemetry#271999

Open
yngrdyn wants to merge 6 commits into
elastic:mainfrom
yngrdyn:event-driven-triggers_testing-modal_telemetry
Open

[One workflow] Instrument event-driven execute modal telemetry#271999
yngrdyn wants to merge 6 commits into
elastic:mainfrom
yngrdyn:event-driven-triggers_testing-modal_telemetry

Conversation

@yngrdyn
Copy link
Copy Markdown
Contributor

@yngrdyn yngrdyn commented May 29, 2026

Relates to https://github.com/elastic/security-team/issues/16717.

Summary

Extends existing telemetry so we can measure whether authors test event-driven workflows before enabling them, and which run-input path they use in the execute modal (event selection, manual JSON, or historical replay).

Adds hasCustomEventTrigger to execution and lifecycle events, documents event as a valid triggerTab value, and wires reporting from test runs, list runs, and enable/disable actions.

Motivation

Product questions we could not answer reliably before:

  1. Pre-activation testing: Do authors run test executions on workflows with extension (event-driven) triggers before turning the workflow on?
  2. Input mode adoption: Among those workflows, how often do authors use the Event tab vs Manual vs Historical when starting a run?

Telemetry changes

New field: hasCustomEventTrigger (boolean, optional)

Present when the workflow definition at action time includes at least one extension trigger type (non-built-in type, same semantics as the Event tab).

Event When emitted
workflows_workflow_test_run_initiated Test run from workflow detail
workflows_workflow_run_initiated Run from workflow list execute modal
workflows_workflow_enabled_state_changed Enable/disable (including YAML save that changes enabled)

Updated field: triggerTab (keyword, optional)

Schema descriptions now include event alongside manual, alert, index, and historical.

Metadata source

hasCustomEventTrigger is derived via extractWorkflowMetadata().

@yngrdyn yngrdyn requested a review from a team as a code owner May 29, 2026 21:27
@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label May 29, 2026
@yngrdyn yngrdyn added backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes labels May 29, 2026
@yngrdyn yngrdyn self-assigned this May 29, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Entity analytics management page - Privileges - should show privileges callout and disable switch for user without risk engine privileges
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Entity analytics management page - Risk Score tab - should discard changes when clicking discard button
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Entity analytics management page - Risk Score tab - should show save bar when toggling closed alerts switch
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Entity analytics management page - Risk Score tab - should show save bar when toggling retain checkbox

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
workflowsManagement 2.5MB 2.5MB +845.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
workflowsManagement 36.3KB 36.8KB +491.0B

History

cc @yngrdyn

Copy link
Copy Markdown
Contributor

@rosomri rosomri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with one comment

if (enabledChanged) {
const enabledValue = workflowUpdate.enabled ?? workflowDefinition?.enabled;
if (enabledValue !== undefined) {
const { hasCustomEventTrigger } = extractWorkflowMetadata(workflowDefinition);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will under-report hasCustomEventTrigger for workflow-list enable/disable actions. Those callers don’t pass workflowDefinition, so extractWorkflowMetadata(workflowDefinition) falls back to false even for event-driven workflows. Could we pass the definition through the list/bulk toggle mutations, or pass this boolean explicitly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants