/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
docs/framework/skip.mdx
52 строки
2 KB
mintlify[bot]
docs(docs): Apply SEO and metadata best practices (#11903)
13 июл 2026, 11:22
Не верифицирован
13 июл 2026, 11:22
01f36ae
Код
Авторство
О чём код?
--- title: 'Skip Function' description: "Skip individual steps of a Novu Framework workflow at runtime based on a condition function evaluated against payload, subscriber, and controls." --- The `skip` action is used to skip the next step in the workflow. `skip` function is available for all the steps in the workflow. ## Common usecases - Skip the step if the user has already seen the notification - Skip the step if the user has not completed the previous step ## Example In this example, we will send an in-app notification for task reminder to the user and then send an email reminder 6 hours later if the user has not read the in-app notification. ```tsx workflow('skip-email-if-in-app-notification-seen', async ({ payload }) => { const inAppNotification = await step.inApp( 'send-in-app-notification', async () => { return { subject: 'Task reminder!', body: 'Task is not yet complete. Please complete the task.', }; }, ); // delay for 6 hrs await step.delay("delay-step-before-email", async () => { return { unit: 'hours', amount: 6, }; }); // send email notification after 6 hrs if the in-app notification has not been read await step.email( 'send-email', () => { return { subject: `Task reminder!`, body: 'Task is not yet complete. Please complete the task.', }; }, { // skip the email step if the in-app notification has been read skip: () => inAppNotification.read === true, } ); }); ```