Skip to content

Commit 6089063

Browse files
authored
Update insert-functions.md Insert Functions only return one event
1 parent a0ccf40 commit 6089063

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/connections/functions/insert-functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ You can read more about [error handling](#destination-insert-functions-logs-and-
183183

184184
A payload must come into the pipeline with the attributes that allow it to match your mapping triggers. You can't use an Insert Function to change the event to match your mapping triggers. If an event comes into an Actions destination and already matches a mapping trigger, that mapping subscription will fire. If a payload doesn't come to the Actions destination matching a mapping trigger, even if an Insert Function is meant to alter the event to allow it to match a trigger, it won't fire that mapping subscription. Segment sees the mapping trigger first in the pipeline, so a payload won't make it to the Insert Function at all if it doesn't come into the pipeline matching a mapping trigger.
185185

186+
Unlike Source Functions and Destination Functions, an Insert Function can only return one event. This means that when the Insert Function receives an event then only one event will be sent to be handled by its configured mappings. However, if you would like [multiple mappings triggered by the same event](https://segment.com/docs/connections/destinations/actions/#:~:text=Multiple%20mappings%20triggered,Subscription%20Updated%20event.), _please see link's details_, you can do so by creating different types of mappings (Identify, Track, Page, etc) or multiple mappings of the same type, and then configuring the mapping's [trigger conditions](https://segment.com/docs/connections/destinations/actions/#conditions) to look for that event name/ type/ or other available field within the payload, and then configure the mapped fields to send different data. You can also configure the Insert Function to add additional data to be included within the event's payload before its handled by the mappings, and then configure the mapping's available fields to reference the payload's available fields. You may want to consider the event's [context object's](https://segment.com/docs/connections/spec/common/#context) available fields when adding new data to the event's payload.
187+
186188
## Create settings and secrets
187189

188190
{% include content/functions/settings.md %}

0 commit comments

Comments
 (0)