PLT-2251 Workflow Validation Investigation

Date: 2026-01-26
Scope: Builder UI workflow validation for extended user attributes

What was reviewed

  • app/src/flowbot/engine/validate.jsx
  • app/src/pages-builder/workflow/index.jsx
  • app/src/flowbot/steps/notification.jsx
  • app/src/flowbot/components/email-builder.jsx

Findings

  • Step config validation is filtered: The workflow builder computes a filtered schema and passes it to step Config as fieldsAllForConfig. This includes the filterMetaSubFields logic that respects selectedExtendedUserAttributes, so step-level validation (e.g., email template variables) should flag missing references when fields are deselected.

  • Global workflow warnings may be unfiltered: The page-level warnings use Flowbot.validate(data.app.dataset.workflow) which relies on workflow.schema from the backend. The backend schema includes pre-expanded meta subfields and does not appear to be filtered by selectedExtendedUserAttributes, so missing extended fields may not be flagged in the global warnings panel.

Evidence

  • Email template variables are validated via EmailBuilder.validate, which checks fieldsAll for matching formKey entries.
  • fieldsAllForConfig is derived from the locally filtered schema in pages-builder/workflow/index.jsx, while Flowbot.validate uses the backend workflow schema.

Manual testing

Manual UI testing was not run in this environment. If needed, test:

  1. Add {{meta.submittedBy.extended.<section>.<field>}} to a notification.
  2. Deselect that field in selectedExtendedUserAttributes.
  3. Observe:
    • Step Config validation should show missing variables.
    • Global warning banner may not update (potential gap).

Follow-up idea (if needed)

If global warnings should reflect the filtered schema, consider calling Flowbot.validate with the filtered schema (or passing it as formSchema) instead of relying solely on the backend workflow.schema.