Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6658 workflows add a first twenty piece email sender #6965

Merged
merged 24 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Code review return: update naming
  • Loading branch information
martmull committed Sep 11, 2024
commit 4bcb22652398facf2b876cdeee2af7e513db3525
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ type WorkflowError = {
};

export type WorkflowStepResult = {
data?: object;
result?: object;
error?: WorkflowError;
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { WorkflowStepExecutorFactory } from 'src/modules/workflow/workflow-step-
const MAX_RETRIES_ON_FAILURE = 3;

export type WorkflowExecutionOutput = {
data?: object;
result?: object;
error?: object;
};

Expand All @@ -33,7 +33,7 @@ export class WorkflowExecutorWorkspaceService {
}): Promise<WorkflowExecutionOutput> {
if (currentStepIndex >= steps.length) {
return {
data: payload,
result: payload,
};
}

Expand All @@ -48,11 +48,11 @@ export class WorkflowExecutorWorkspaceService {
payload,
});

if (result.data) {
if (result.result) {
return await this.execute({
currentStepIndex: currentStepIndex + 1,
steps,
payload: result.data,
payload: result.result,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ export class CodeWorkflowStepExecutor {
return { error: result.error };
}

return { data: result.data || {} };
return { result: result.data || {} };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class SendEmailWorkflowStepExecutor {
if (!result.success) {
this.logger.warn(`Email '${payload.email}' invalid`);

return { data: { success: false } };
return { result: { success: false } };
}

const mainText = Handlebars.compile(step.settings.template)(payload);
Expand Down Expand Up @@ -69,7 +69,7 @@ export class SendEmailWorkflowStepExecutor {
html,
});

return { data: { success: true } };
return { result: { success: true } };
} catch (error) {
return { error };
}
Expand Down
Loading