fix(workflow): replace automatedExecution with executionType#1590
fix(workflow): replace automatedExecution with executionType#1590EnkiP wants to merge 6 commits into
Conversation
2 new issues
|
Scra3
left a comment
There was a problem hiding this comment.
Good direction on the enum migration. A few architectural and documentation points before merge.
|
|
||
| import { z } from 'zod'; | ||
|
|
||
| import { ServerStepExecutionTypeEnum } from '../../adapters/server-types'; |
There was a problem hiding this comment.
issue (non-blocking): ServerStepExecutionTypeEnum from the adapter layer leaks into the domain schema — declare a StepExecutionMode enum here in types/validated/ instead and have step-definition-mapper.ts be the single translation point. Executors should import from types/validated/, never from adapters/.
| const baseRecordFields = { | ||
| ...baseFields, | ||
| automaticExecution: z.boolean().optional(), | ||
| executionType: z.enum(ServerStepExecutionTypeEnum).optional(), |
There was a problem hiding this comment.
nit: z.enum() is designed for string-tuple arrays; z.nativeEnum(StepExecutionMode) is the idiomatic form for TypeScript enum objects — use it once the domain enum is declared above.
There was a problem hiding this comment.
what about the commentary: Use z.enum(EnumObject), not z.nativeEnum — the latter is deprecated in zod 4.
| } | ||
|
|
||
| // Branch C -- Awaiting confirmation | ||
| // Branch C -- Awaiting confirmation (also covers Manual fallback) |
There was a problem hiding this comment.
issue (non-blocking): also covers Manual fallback hides an intentional design choice — document explicitly that manual and automatedWithConfirmation share Branch C because the AI suggestion is always computed and the distinction is UI-only (how the front presents the confirmation to the user).
There was a problem hiding this comment.
Also, add a warning logs if we receive "manual". Add it on each step
| } | ||
|
|
||
| // Branch C -- pre-fetch candidates, await user confirmation | ||
| // Branch C -- pre-fetch candidates, await user confirmation (also covers Manual fallback) |
There was a problem hiding this comment.
issue (non-blocking): same as update-record — document why manual and automatedWithConfirmation intentionally share Branch C.
| } | ||
|
|
||
| // Branch C -- Awaiting confirmation (frontend executes the action, including forms) | ||
| // Branch C -- Awaiting confirmation (frontend executes the action, including forms). |
There was a problem hiding this comment.
issue (non-blocking): same — document the intentional equivalence of manual and automatedWithConfirmation in Branch C.
| } | ||
|
|
||
| // Branch C -- Awaiting confirmation | ||
| // Branch C -- Awaiting confirmation (also covers Manual fallback) |
There was a problem hiding this comment.
issue (non-blocking): same — document the intentional equivalence of manual and automatedWithConfirmation in Branch C.

Definition of Done
fixes PRD-378
need frontend PR: https://github.com/ForestAdmin/forestadmin/pull/9708
and backend PR: https://github.com/ForestAdmin/forestadmin-server/pull/8254
branch name is always
fix/execution-typeGeneral
Security
Note
[!NOTE]
Replace
automaticExecutionwithexecutionTypeenum across workflow step executorsautomaticExecutionboolean from all step schemas instep-definition.tsand replaces it with an optionalexecutionTypeenum (ServerStepExecutionTypeEnum:FullyAutomated,AutomatedWithConfirmation,Manual).TriggerRecordActionStepExecutor,UpdateRecordStepExecutor,LoadRelatedRecordStepExecutor,McpStepExecutor) to branch onexecutionType === FullyAutomatedinstead ofautomaticExecution.ConditionStepExecutor: whenexecutionType=Manualand no incoming pending data exists, the step returnsawaiting-inputwithout calling the AI.build-workflow-executor.tsfrom 5000 ms to 30000 ms.automaticExecutionis no longer accepted in step definitions; any callers still passing this field will have it ignored or fail schema validation.Changes since #1590 opened
ServerStepExecutionTypeEnumwithStepExecutionModeenum throughoutworkflow-executorpackage [77f5301]warnmethod toLoggerinterface and all logger implementations and test mocks [77f5301]Macroscope summarized 851e5ee.