Skip to content

Commit 5f64a99

Browse files
committed
Update docs for workflow trigger and Inbox to not upsert context but rather do findOrCreate,
1 parent 7347e70 commit 5f64a99

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

content/docs/platform/inbox/configuration/inbox-with-context.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ This creates predictable isolation and ensures notifications can't accidentally
2525

2626
### Creating context via `<Inbox/>`
2727

28-
If a new context is passed from the <Method href="/platform/inbox/configuration/inbox-with-context">{`<Inbox />`}</Method> that doesn’t already exist, Novu will automatically create it. This means you don’t have to manually set up contexts before using them, they are created just in time.
28+
If a new context is passed from the <Method href="/platform/inbox/configuration/inbox-with-context">{`<Inbox />`}</Method> that doesn’t already exist, Novu will automatically find or create it. This means you don’t have to manually set up contexts before using them, they are created just in time.
29+
30+
However, if a context already exists, its data won’t be updated automatically. This prevents unintentional overwrites of stored context data.
2931

3032
This is particularly useful for:
3133

content/docs/platform/workflow/contexts/manage-contexts.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ await novu.trigger('welcome-email', {
9393
});
9494
```
9595

96+
If a matching context already exists, Novu reuses it as-is without modifying any stored data. This behavior ensures consistency and avoids accidental changes to shared metadata.
97+
9698
## Update a context
9799

98-
You can update a context’s data payload at any time. The context `type` and `id` remain immutable.
100+
You can update a context’s data payload at any time. The context `type` and `id` remain immutable. However, to change an existing context’s data, you must explicitly update it through the dashboard or API.
99101

100102
#### Update a context via dashboard
101103

@@ -165,7 +167,7 @@ GET /v2/contexts?search=acme
165167

166168
Delete a context if it’s no longer needed. This action permanently removes the context from your Novu environment.
167169

168-
<Callout type='warn'>This action cannot be undone, so ensure the context is no longer required by any active or historical workflows you might need to analyze.</Callout>
170+
<Callout type='warn'> Deleting a context cannot be undone. Ensure the context is no longer required by any active or historical workflows you might need to analyze. </Callout>
169171

170172
### Delete a context via dashboard
171173

0 commit comments

Comments
 (0)