Skip to content

Commit 1782456

Browse files
fix typos and missing run on readme
1 parent 2bdced6 commit 1782456

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

email-sender/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ add OPENAI_API_KEY, SENDGRID_API_KEY, FROM_EMAIL, TO_EMAIL in .env
3131

3232
```bash
3333
npm i
34-
npm build
35-
npm dev
34+
npm run build
35+
npm run dev
3636
```
3737

3838
Your code will be running and syncing with Restack engine to execute workflows or functions.
@@ -55,4 +55,4 @@ In another shell:
5555
npm run schedule-retries
5656
```
5757

58-
Will schedule to start example workflow immediately. The code for this is on `scheduleWorkflowRetries.ts`. In here you can see how the sendEmailWorkflow is scheduled to be exectuted and the step to generate email content is force to have a failure and show how Restack will handle retries automatically for you. Step will fail once and be successfull on the next retry, then rest of steps defined on workflow will be exectuted correctly
58+
This will schedule the example workflow to start immediately. The code for this is in `scheduleWorkflowRetries.ts`. In this file, you can see how the `sendEmailWorkflow` is scheduled for execution. The step to generate email content is intentionally set to fail once, demonstrating how Restack automatically handles retries. After the first failure, the step will succeed on the next retry, and the remaining steps in the workflow will execute as expected.

email-sender/src/functions/sendEmail.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ export async function sendEmail({ text, subject, to }: EmailInput) {
3636
} catch (error) {
3737
throw FunctionFailure.nonRetryable('Failed to send email');
3838
}
39+
40+
return 'Email sent successfully';
3941
}

email-sender/src/workflows/sendEmail.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ export async function sendEmailWorkflow({
3636
});
3737

3838
log.info('Email sent successfully');
39+
return 'Email sent successfully';
3940
}

0 commit comments

Comments
 (0)