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
10 changes: 6 additions & 4 deletions apps/http-backend/src/routes/userRoutes/executionRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const execRouter: Router = Router()

execRouter.post('/node', userMiddleware, async(req: AuthRequest, res: Response)=>{
try{
if(!req.user){
if(!req.user?.sub){
return res.status(statusCodes.BAD_REQUEST).json({
message: "User is not logged in ",
});
Expand All @@ -30,15 +30,17 @@ execRouter.post('/node', userMiddleware, async(req: AuthRequest, res: Response)
const type = nodeData.AvailableNode.type
const config = dataSafe.data.Config ? dataSafe.data.Config : nodeData.config // for test api data prefered fist then config in db
console.log(`config and type: ${JSON.stringify(config)} & ${type}`)
// if(nodeData.CredentialsID)
const context = {
userId: req.user.sub || "",
config: config
userId: req.user.sub,
config: config ,
// credentialsId: nodeData.CredentialsID || ""
}
const executionResult = await ExecutionRegister.execute(type, context)

console.log(`Execution result: ${executionResult}`)

if(executionResult)
if(executionResult.success)
return res.status(statusCodes.ACCEPTED).json({
message: `${nodeData.name} node execution done` ,
data: executionResult
Expand Down
1 change: 1 addition & 0 deletions apps/worker/src/engine/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export async function executeWorkflow(
nodeId: node.id,
workflowExecId: workflowExecutionId,
status: "Start",
inputData: currentInputData ? currentInputData : {},
startedAt: new Date()
}
})
Expand Down
6 changes: 3 additions & 3 deletions packages/nodes/src/registry/execution.registory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ExecutionRegistry {
} catch (error: any) {
return {
success: false,
error: error,
error: error instanceof Error ? error.message : String(error),
};
}
}
Expand All @@ -38,8 +38,8 @@ class ExecutionRegistry {


//wehen visits this next time make sure chang gmail executor implements NodeExecutor
this.register("gmail", new GmailExecutor() as unknown as NodeExecutor);
this.register("google_sheet", new GoogleSheetsNodeExecutor() as unknown as NodeExecutor)
this.register("gmail", new GmailExecutor() as NodeExecutor);
this.register("google_sheet", new GoogleSheetsNodeExecutor() as NodeExecutor)
console.log(`The current Executors are ${this.executors.size}`);
}
}
Expand Down