Event Properties
Whenever an event occurs during your bot’s execution—like a message being sent—you can access details about that event using the event object’s properties.
The event object is available wherever you can use code in Botpress Studio. This includes:
You can also access the event object within certain Cards’ configuration fields.
This documentation omits certain properties of the event object which exist to maintain internal functionality and
aren’t useful for bot builders Happy bot building! .
eventIncomingEvent
Information about the last incoming event in your bot's execution.
botIdstring
The ID of the bot that experienced the event.
conversationId?string
The ID of the conversation that the event took place in.
createdOnDate
The date and time when the event was created (in ISO 8601 format).
directionEventDirection
The direction of the event, indicating whether the event was received by
the bot or sent from the bot. - `'incoming'`: The event originated from
the user and was received by the bot. - `'outgoing'`: The event was
generated by the bot and sent to the user.
idstring
The unique identifier for the event.
integration?string
The integration that the event occurred on.
kb?object
Information about Knowledge Bases queried for the event.
includedStudio.KnowledgeBase.KB[]
Array of Knowledge Bases queried for the event.
Since most of this object's properties are for internal use by
Botpress, we've omitted its deeper structure from this
documentation.
results?Studio.KnowledgeBase.ContentResult[]
Array of Knowledge Base results consulted for this event.
Since most of this object's properties are for internal use by
Botpress, we've omitted its deeper structure from this
documentation.
messageId?string
The unique identifier for the current event's message.
payloadobject
The payload for the current event.
previewstring
A representation of the event in plain text. If the event is a text
message, this property will contain the message itself.
stateEventState
Data related to the state of the event.
Since most of this object's properties are for internal use by
Botpress, we've omitted its deeper structure from this documentation.
tags?EventTags
Any tags associated with the current event. These can contain useful data
related to the integration associated with the event.
conversation?object
Tags for the conversation.
message?object Tags for the message.
user?object Tags for the user.
trigger?DM.Trigger
The Trigger that sent the event.
conversationId?string
The ID of the conversation associated with this Trigger.
eventName?string
The name of the event that the Trigger sent.
flowIdstring
The ID of the Workflow containing the Trigger.
integration?string
The integration associated with the Trigger.
nodeIdstring
The ID of the Node that contains the Trigger.
userId?string
The ID of the user associated with this Trigger.
typestring The type of the event.
userId?string
The user ID associated with this event.