Skip to main content

A chat message arrives

Triggerchat-message

Starts when someone writes in the chat. The flow's reply is what they read back.

At a glance​

PropertyValue
Trigger namechat-message
ResourceClusterTrigger (lumen.ai/v1alpha1)
Sourceevent
Needs a connectionno
Producestext, fields
Emitsitem
Installation must providenothing

The trigger goes under spec.triggers of a Flow. Its outputs are referenced as <triggerId>.<field>. A trigger can also carry a when condition ("Start only when") and disabled: true.

Outputs​

A later node references an output as {nodeId.field} in text, or nodeId.field in a condition.

OutputType
sessionIdstring
messagestring

Settings​

Set under config: on the flow trigger.

SettingTypeDefaultDescription
greetingstring-Greeting is what a chat window shows before the first message.maxLength 500

The full JSON Schema of these settings: chat-message.schema.json.

Use it in a flow​

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: chat-message-example
namespace: tenant-acme
spec:
displayName: "A chat message arrives"
triggers:
- id: start
ref: {name: chat-message}
next: [notify-in-app]
nodes:
- id: notify-in-app
stepRef: {name: notify-in-app}
config:
body: 'Total: {total}'
title: New invoice from {supplier}
to: admins