fix(core): Update migration that activate workflows with executeWorkflowTrigger #22860
+92
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
ActivateExecuteWorkflowTriggerWorkflowsmigration to properly handle all valid Execute Workflow Trigger configurations, including:typefields in workflowInputs (which default to "string")Root cause
The migration logic was too strict in validating Execute Workflow Trigger nodes:
Version 1 nodes: These nodes have no
inputSourceparameter and use emptyparameters: {}. The migration was not recognizing empty parameters as valid, failing to activate workflows with v1 Execute Workflow Trigger nodes.Version 1.1 nodes with missing types: The Execute Workflow Trigger v1.1 has a default type of "string" for workflow inputs. When users don't explicitly set a type, it's not included in the JSON. The migration's
hasValidWorkflowInputs()validation required thetypefield to exist, incorrectly rejecting valid configurations.Changes
Migration (1763048000000-ActivateExecuteWorkflowTriggerWorkflows.ts)
Version 1 support (lines 99-102): Added check for empty or missing parameters object. If
!params || Object.keys(params).length === 0, the workflow is considered valid and will be activated.Version 1.1 missing type support (lines 195-196): Updated
hasValidWorkflowInputs()to treat missingtypefield as valid: