Skip to content

Commit fc3414d

Browse files
committed
refactor: Simplify execution record creation in WorkflowExecutor by removing unnecessary store usage
1 parent 2fffccf commit fc3414d

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

apps/api/src/services/workflow-executor.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import type { Node, WorkflowExecution } from "@dafthunk/types";
99

1010
import type { Bindings } from "../context";
11-
import { ExecutionStore } from "../stores/execution-store";
1211
import { createSimulatedEmailMessage } from "../utils/email";
1312
import { createSimulatedHttpRequest } from "../utils/http";
1413

@@ -136,25 +135,12 @@ export class WorkflowExecutor {
136135
status: "executing" as const,
137136
}));
138137

139-
// Save initial execution record
140-
const executionStore = new ExecutionStore(env);
141-
const initialExecution = await executionStore.save({
138+
// Create initial execution record
139+
const execution: WorkflowExecution = {
142140
id: executionId,
143141
workflowId: workflow.id,
144-
deploymentId,
145-
userId,
146-
organizationId,
147-
status: "executing",
148-
nodeExecutions,
149-
createdAt: new Date(),
150-
updatedAt: new Date(),
151-
});
152-
153-
const execution: WorkflowExecution = {
154-
id: initialExecution.id,
155-
workflowId: initialExecution.workflowId,
156142
status: "submitted",
157-
nodeExecutions: initialExecution.nodeExecutions,
143+
nodeExecutions,
158144
};
159145

160146
console.log(

0 commit comments

Comments
 (0)