Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/workflow-executor/src/adapters/server-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export type ServerWorkflowRunState = 'started' | 'pending' | 'loading' | 'aborte
export enum ServerWorkflowTriggerType {
manual = 'manual',
webhook = 'webhook',
mcp = 'mcp',
}

export interface ServerHydratedWorkflowRun {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export type Step = z.infer<typeof StepSchema>;
export enum TriggerType {
Manual = 'manual',
Webhook = 'webhook',
Mcp = 'mcp',
}
export const TriggerTypeSchema = z.nativeEnum(TriggerType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ describe('toAvailableStepExecution', () => {
expect(result?.triggerType).toBe(TriggerType.Webhook);
});

it('should map an mcp-triggered run without failing validation', () => {
const run = makeRun({ triggerType: ServerWorkflowTriggerType.mcp });

const result = toAvailableStepExecution(run);

expect(result?.triggerType).toBe(TriggerType.Mcp);
});

it('should default triggerType to manual when the orchestrator omits it', () => {
const run = makeRun();
delete run.triggerType;
Expand Down
Loading