Skip to content

Commit 0707f41

Browse files
Merge pull request #70 from atapiawastaken/example-loom
fix typos and missing run on readme
2 parents e33357b + 1782456 commit 0707f41

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

email-sender/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)