novu-design-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDesign Workflow
设计工作流
Design rules for any Novu workflow — independent of whether you author it in the Dashboard (no-code) or in code with . The decisions here (channels, severity, critical, digest, conditions) are the same on both surfaces; only the syntax differs.
@novu/frameworkAuthoring in code? Pair this skill withforframework-integration/,workflow(...),step.*, and Bridge Endpoint setup. Authoring in the Dashboard or via the Novu MCP? After designing here, fill in step content (subject, body,controlSchema, headers, conditions) usingeditorType.dashboard-workflows/
为任意Novu工作流设计规则——无论你是在仪表盘(无代码)中创建,还是使用通过代码创建。此处的决策(渠道、优先级、关键状态、摘要、条件)在两种方式下都是一致的;仅语法有所不同。
@novu/framework采用代码方式创建?请将此技能与结合使用,以完成framework-integration/、workflow(...)、step.*和Bridge端点的设置。 在仪表盘或通过Novu MCP创建?完成此处的设计后,请使用controlSchema填写步骤内容(主题、正文、dashboard-workflows/、标头、条件)。editorType
When to use this skill
何时使用此技能
Use it whenever you need to decide what a workflow should look like:
- "Design an order-confirmation workflow"
- "Which channels should I send for a payment failure?"
- "Make this notification critical"
- "Should this be digested?"
- "Add a fallback for offline subscribers"
- "What's the right template for X?"
Do not use it for: triggering an existing workflow (), authoring code wrappers (), or rendering severity in the UI ().
trigger-notification/framework-integration/inbox-integration/每当你需要确定工作流的形态时,都可以使用它:
- "设计订单确认工作流"
- "支付失败时应发送到哪些渠道?"
- "将此通知设为关键通知"
- "是否应对此进行摘要处理?"
- "为离线订阅者添加备选方案"
- "X场景适合哪种模板?"
请勿将其用于:触发现有工作流()、编写代码包装器()或在UI中呈现优先级()。
trigger-notification/framework-integration/inbox-integration/Severity & Critical
优先级与关键状态
Two independent dials. Most workflows set neither.
| Dial | Values | Default | Effect |
|---|---|---|---|
| | unset | Visual prioritization in the Inbox (color, glow); informs digest skip rules. |
| | | Bypass subscriber preferences, skip digest, no delays, all available channels. |
Rules of thumb:
- Leave unset for most workflows. Only set it when visual prioritization is needed.
severity - = "deal with this today" (payment failed, trial expiring tomorrow).
HIGH - = "deliver regardless of preferences" (account suspended, security alert, password reset).
critical: true - ⇒ digest is automatically skipped and channels deliver immediately.
critical: true
See for the full behavior matrix and the vs distinction.
references/severity-and-critical.mdreadOnlycritical两个独立的设置项。大多数工作流都不会设置这两项。
| 设置项 | 取值 | 默认值 | 效果 |
|---|---|---|---|
| | 未设置 | 在收件箱中进行视觉优先级区分(颜色、高亮);决定摘要跳过规则。 |
| | | 绕过订阅者偏好设置,跳过摘要处理,无延迟,使用所有可用渠道。 |
经验法则:
- 大多数工作流无需设置。仅当需要视觉优先级区分时才设置。
severity - = "今日需处理"(支付失败、明日试用到期)。
HIGH - = "无论偏好如何都需送达"(账户暂停、安全警报、密码重置)。
critical: true - ⇒ 自动跳过摘要处理,渠道立即发送通知。
critical: true
查看获取完整行为矩阵以及与的区别。
references/severity-and-critical.mdreadOnlycriticalChannel Selection
渠道选择
If the user specified channels
如果用户指定了渠道
Use only those channels. Do not add fallbacks. Do not add extras. If the requested channel isn't configured in the organization, add it anyway because the user explicitly asked for it.
"Send a push notification when the order ships" → onestep. Nothing else.push
仅使用这些指定的渠道。不要添加备选渠道,不要额外添加其他渠道。如果请求的渠道未在组织中配置,仍需添加,因为用户明确要求了该渠道。
"订单发货时发送推送通知" → 仅一个步骤,无其他内容。push
If the user did NOT specify channels
如果用户未指定渠道
Pick from channels configured in the organization, in this priority order, up to 3 channels:
In-App > Email > Chat > Push > SMS| Channel | Use it for | Skip it when |
|---|---|---|
| In-App | Default for in-product content. Always include if the user is in your product. | The recipient can't see it (password reset, OTP, pre-signup) |
| Receipts, documentation, async communication. Default fallback after In-App. | Pure conversational pings inside the product | |
| Chat | If configured AND | Marketing or low-severity nudges |
| Push | Fallback when subscriber is offline but needs immediate awareness. | Subscriber is online (use In-App instead) |
| SMS | Last resort. Only when no other channel works (true emergencies, OTP, regulatory). | Anything that fits in Email or Push |
See for the full decision tree.
references/channel-selection.md从组织中已配置的渠道中选择,按以下优先级排序,最多选3个渠道:
In-App > Email > Chat > Push > SMS| 渠道 | 使用场景 | 跳过场景 |
|---|---|---|
| In-App | 产品内内容的默认渠道。如果用户在你的产品内,务必包含此渠道。 | 收件人无法查看(密码重置、一次性验证码、注册前通知) |
| 收据、文档、异步沟通。In-App之后的默认备选渠道。 | 产品内纯对话式提醒 | |
| Chat | 如果已配置且 | 营销类或低优先级提醒 |
| Push | 订阅者离线但需要立即知晓时的备选渠道。 | 订阅者在线(改用In-App) |
| SMS | 最后手段。仅当其他渠道都无法使用时(真正的紧急情况、一次性验证码、合规要求)。 | 任何适合通过Email或Push发送的内容 |
查看获取完整决策树。
references/channel-selection.mdDigest Defaults
摘要默认设置
When you add a digest step, default to:
type: "regular"- look-back window: 5 minutes
- digest time: 1 hour
- key: (and
subscriberIdfor conversational flows)+threadId
Skip the digest when:
- , or
severity: HIGH critical: true
See for digest key composition and conversational examples.
references/digest-defaults.md添加摘要步骤时,默认采用:
type: "regular"- 回溯窗口:5分钟
- 摘要时间:1小时
- 键:(对话式流程需添加
subscriberId)+threadId
跳过摘要处理的情况:
- ,或
severity: HIGH critical: true
查看获取摘要键的组成方式和对话式流程示例。
references/digest-defaults.mdUser-State Logic
用户状态逻辑
Adapt routing based on whether the subscriber is online:
| State | Behavior |
|---|---|
| Online | Send In-App immediately. Skip Push. Delay Email/Chat based on severity. |
| Offline | Use Push or Chat to get attention. |
Default delays:
- B2B apps → next work hour
- B2C apps → ~30 minutes
The condition for "subscriber offline" is the same on both surfaces — see .
references/step-conditions.md根据订阅者是否在线调整路由:
| 状态 | 行为 |
|---|---|
| 在线 | 立即发送In-App通知。跳过Push。根据优先级延迟发送Email/Chat。 |
| 离线 | 使用Push或Chat吸引用户注意。 |
默认延迟时间:
- B2B应用 → 下一个工作时段
- B2C应用 → 约30分钟
“订阅者离线”的判定条件在两种方式下是一致的——查看。
references/step-conditions.mdWorkflow Templates
工作流模板
Match the use case to a template and copy its shape. Each template specifies severity, critical, actionable, and interaction type, plus the step ordering.
| # | Use case | Severity | Critical | Notes |
|---|---|---|---|---|
| 1 | Order Confirmation | none | false | Digested, In-App + Email + Push (offline only) |
| 2 | Comment on Your Post | none | false | Digested by |
| 3 | Payment Failed | HIGH | false | In-App + Chat + Email + Push (offline) |
| 4 | Account Suspended | HIGH | true | All channels, no preferences, no digest |
| 5 | Forgot Password | none | true | Email + SMS only, no In-App |
| 6 | Trial Expiring Tomorrow | HIGH | false | In-App + Chat + Email + Push (offline) |
| 7 | Explicit Channel Request | n/a | n/a | Use only the channels the user specified |
| 8 | Webhook / External API Call | varies | varies | Add |
| 9 | Fetch Data then Notify | varies | varies | |
Full ASCII flows + per-template metadata in .
references/workflow-templates.md将用例与模板匹配并复制其结构。每个模板都指定了优先级、关键状态、可操作性和交互类型,以及步骤顺序。
| # | 用例 | 优先级 | 关键状态 | 备注 |
|---|---|---|---|---|
| 1 | 订单确认 | 无 | false | 摘要处理,In-App + Email + Push(仅离线时) |
| 2 | 你的帖子收到评论 | 无 | false | 按 |
| 3 | 支付失败 | HIGH | false | In-App + Chat + Email + Push(离线时) |
| 4 | 账户暂停 | HIGH | true | 所有渠道,无视偏好设置,无摘要处理 |
| 5 | 忘记密码 | 无 | true | 仅Email + SMS,无In-App |
| 6 | 试用明日到期 | HIGH | false | In-App + Chat + Email + Push(离线时) |
| 7 | 明确渠道请求 | 不适用 | 不适用 | 仅使用用户指定的渠道 |
| 8 | Webhook / 外部API调用 | 可变 | 可变 | 在渠道步骤后添加 |
| 9 | 先获取数据再通知 | 可变 | 可变 | 先执行 |
完整的ASCII流程图 + 各模板元数据请查看。
references/workflow-templates.mdStep Conditions
步骤条件
Conditions decide whether a step runs. Use them for "send only if subscriber is offline", "send email only if In-App wasn't seen", and similar fallbacks.
- Dashboard authors write JSON-Logic:
{ "==": [{ "var": "subscriber.isOnline" }, "false"] } - Framework authors pass a callback to the step.
skip: () => boolean
The semantics are identical. See for the canonical snippets and the variables available in each scope.
references/step-conditions.md条件决定步骤是否运行。可用于“仅当订阅者离线时发送”、“仅当In-App通知未被查看时发送邮件”等类似的备选场景。
- 仪表盘创建者编写JSON-Logic:
{ "==": [{ "var": "subscriber.isOnline" }, "false"] } - Framework创建者向步骤传递回调函数。
skip: () => boolean
语义完全一致。查看获取标准代码片段以及各作用域中可用的变量。
references/step-conditions.mdCommon Pitfalls
常见误区
- Don't set severity by default — leave it unset unless you actually need visual prioritization.
- is not the same as
critical: true—readOnly: trueonly hides the workflow from the Preferences UI;readOnlybypasses preferences and digests at runtime. Seecritical.references/severity-and-critical.md - Don't add fallbacks when the user named the channels — explicit channel requests are exact.
- Cap the channel count at 3 when the user didn't specify channels. More channels = more annoyance, not more reach.
- Don't combine digest with — critical workflows must deliver immediately. The digest step is auto-skipped.
critical: true - Digest key matters for conversational flows — without , a comment on Post A and a comment on Post B end up in the same digest.
+threadId - Push only when offline — sending push to an online user duplicates the In-App alert.
- HTTP step needs — without it, downstream steps can't read response properties via
responseBodySchema.{{ steps.<id>.<prop> }}
- 不要默认设置优先级——除非确实需要视觉优先级区分,否则保持未设置状态。
- 与
critical: true不同——readOnly: true仅在偏好设置UI中隐藏工作流;readOnly在运行时绕过偏好设置和摘要处理。查看critical。references/severity-and-critical.md - 当用户指定渠道时不要添加备选渠道——明确的渠道请求需严格执行。
- 用户未指定渠道时,渠道数量上限为3——渠道越多,用户越反感,而非覆盖范围越广。
- 不要将摘要处理与结合——关键工作流必须立即送达。摘要步骤会被自动跳过。
critical: true - 对话式流程的摘要键很重要——如果没有,帖子A和帖子B的评论会被归入同一摘要。
+threadId - 仅在离线时发送Push——向在线用户发送Push会与In-App提醒重复。
- HTTP步骤需要——没有它,下游步骤无法通过
responseBodySchema读取响应属性。{{ steps.<id>.<prop> }}
References
参考资料
- Channel Selection — full decision tree and per-channel guidance
- Severity & Critical — behavior matrix, preference & digest interactions, vs
readOnlycritical - Digest Defaults — windows, keys, conversational digest patterns
- Step Conditions — JSON-Logic snippets and Framework equivalents
skip - Workflow Templates — the 9 reference flows with severity/critical/interaction tables
- 渠道选择 — 完整决策树和各渠道指南
- 优先级与关键状态 — 行为矩阵、偏好设置与摘要处理的交互、与
readOnly的区别critical - 摘要默认设置 — 时间窗口、键、对话式摘要模式
- 步骤条件 — JSON-Logic代码片段和Framework的等效写法
skip - 工作流模板 — 9个参考流程,包含优先级/关键状态/交互表
See Also
另请参阅
- — author step content (subject, body,
dashboard-workflows/, headers, conditions) for Dashboard or Novu MCP workflowseditorType - — implement these designs in code (
framework-integration/,workflow(),step.*, Bridge)controlSchema - — how
manage-preferences/interacts with subscriber-level preferencescritical - — how severity surfaces visually in the Inbox
inbox-integration/ - — invoking a workflow once it's designed
trigger-notification/
- — 为仪表盘或Novu MCP工作流编写步骤内容(主题、正文、
dashboard-workflows/、标头、条件)editorType - — 在代码中实现这些设计(
framework-integration/、workflow()、step.*、Bridge)controlSchema - —
manage-preferences/如何与订阅者级偏好设置交互critical - — 优先级如何在收件箱中视觉呈现
inbox-integration/ - — 工作流设计完成后调用它
trigger-notification/