Update workflow version struct (#6716)

We want to avoid the nested structure of active pieces. Steps to execute
will now be separated from the trigger. It will be an array executed
sequentially.

For now a step can only be an action. But at some point it will also be
a branch or a loop
This commit is contained in:
Thomas Trompette
2024-08-22 17:59:16 +02:00
committed by GitHub
parent 579c2ebcea
commit 0a7700351f
18 changed files with 131 additions and 114 deletions

View File

@ -27,9 +27,9 @@ export function assertWorkflowVersionIsValid(
);
}
if (!workflowVersion.trigger.nextAction) {
if (!workflowVersion.steps || workflowVersion.steps.length === 0) {
throw new WorkflowTriggerException(
'No next action provided in trigger',
'No steps provided in workflow version',
WorkflowTriggerExceptionCode.INVALID_WORKFLOW_TRIGGER,
);
}