Migrate workflow actions to executors (#10432)

Actions will now:
- receive the complete input
- get the step they want to execute by themself
- check that the type is the right one
- resolve variables

These all share a common executor interface.

It will allow for actions with a special execution process (forms, loop,
router) to have all required informations.

Main workflow executor should:
- find the right executor to call for current step
- store the output and context from step execution
- call next step index
This commit is contained in:
Thomas Trompette
2025-02-24 14:36:24 +01:00
committed by GitHub
parent 1f2c5c5fa5
commit 446924cf24
24 changed files with 320 additions and 155 deletions

View File

@ -22,6 +22,7 @@ import { FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/f
import { TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
import { WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
import { WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
import { WorkflowExecutorOutput } from 'src/modules/workflow/workflow-executor/types/workflow-executor-output.type';
import { WorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
import { WorkflowTrigger } from 'src/modules/workflow/workflow-trigger/types/workflow-trigger.type';
@ -32,13 +33,9 @@ export enum WorkflowRunStatus {
FAILED = 'FAILED',
}
type StepRunOutput = {
export type StepOutput = {
id: string;
outputs: {
attemptCount: number;
result: object | undefined;
error: string | undefined;
}[];
output: WorkflowExecutorOutput;
};
export type WorkflowRunOutput = {
@ -46,7 +43,7 @@ export type WorkflowRunOutput = {
trigger: WorkflowTrigger;
steps: WorkflowAction[];
};
stepsOutput?: Record<string, StepRunOutput>;
stepsOutput?: Record<string, WorkflowExecutorOutput>;
error?: string;
};