You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/docs/pages/references/functions.mdx
+14-20Lines changed: 14 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,15 @@ functions:
29
29
30
30
### Synchronous execution with synchronization key
31
31
32
-
To ensure that function executions are processed in order, FIFO, for a given context such as a user or conversation, enable synchronization support in your function’s manifest and use a synchronization key, sync-id.
32
+
To ensure that function executions are processed in order, FIFO, for a given context such as a user or conversation, enable synchronization support in your function’s manifest and use a synchronization key, sync_id.
33
33
34
-
#### How it works
34
+
The platform uses the sync_id as the message group for FIFO processing. This ensures that all executions with the same sync_id are processed in order, preventing race conditions or duplicate conversations.
35
+
Use cases for synchronous execution include:
36
+
37
+
- Ensuring order of message processing for chatbots or messaging integrations.
38
+
- Preventing duplicate or out-of-order actions when multiple events are triggered.
39
+
40
+
To enable this:
35
41
36
42
1. Enable synchronization in manifest
37
43
- In your function’s manifest, add the field:
@@ -44,8 +50,8 @@ To ensure that function executions are processed in order, FIFO, for a given con
44
50
- This tells the platform to use a FIFO queue for this function.
45
51
46
52
1. Set the synchronization key
47
-
- When triggering an automation, include the sync-id in your rego policy along with the `event_key`. For example:
48
-
```rego focus
53
+
- When triggering an automation, include the sync_id in your rego policy along with the `event_key`. For example:
0 commit comments