# Comet Messages

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_NpOsk0sjotPXNy29Q%2Fuploads%2FXco2GLodUeHQKekhrJEF%2Fcomet-node.svg?alt=media\&token=a6feb734-c8d8-47c2-8986-98677ebcdb88)

In WEM it is possible to generate and listen to a message stream using Comet. Based on these messages a specific action can be taken (e.g. write to a log or display popup on all user's screens). This happens in realtime and can be applied in (action)flowcharts and HTTP endpoint flows. To use this functionlity, you need the realtime message node:

* You need a node to send a message;
* You need one or more nodes to listen to messages ("Chanels");
* You can use a node to stop listening.

All of this is done through the realtime message node. But before you can use this node, you need to [define realtime messages](https://docs.wem.io/platform/wemmodeler/services-and-integration/comet-real-time-messages). Once this has been done you can use the node.

The properties of the node define how the node will behave: as a sender or a listener.\
Let's look at the various properties.\
For the various node "Actions", there is a different set of properties. Three properties are always available:

* `Name`: the name of the node, which is set by WEM and cannot be changed;
* `Channel name`: this is the name of the messaging channel you want to use. You are free to give it any name you want, as long as it is unique within the application. When you are listening to messages, or want to stop listening to messages, you need to specify the name of an existing channel;
* `Action`: This property defines how the node will behave:
  * `Start listening` - the node will behave as a listener on a particular channel;
  * `Send message` - the node will now behave as a sender on a particular channel;
  * `Stop listening` - the node will stop the the listening on a particular channel.

Depending on the action, the remaining properties vary.

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_NpOsk0sjotPXNy29Q%2F-L_mjrxoCFlx3Q2zjX20%2F-L_mjv1vDBzJNbNXe6Nl%2Fwem-modeler.nodes.realtime-props-start.png?generation=1552408462623106\&alt=media)

**Start listening**

| Property            | Options                                            | Description                                                                                                                                                                                                                                                                                                           |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Start listening to: | - Any message - Specific message                   | Listen to any message that is send on a particular channel or listen to a particular message. This distinction is only needed if more than one (1) message has been defined. When there are multiple messages, you need to select the message you want to listen to in case you are not listening to all the messages |
| Response action:    | - Refresh screen - Execute flowchart - Navigate to | When a message arrives, you need to tell the node which action must be executed. When you select `Execute flowchart` you must specify the flowchart that should be execute, and when you choose `Navigate to`, you need to select the navigation point.                                                               |

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_NpOsk0sjotPXNy29Q%2F-L_mjrxoCFlx3Q2zjX20%2F-L_mjv1x1KBUceeNA5j2%2Fwem-modeler.nodes.realtime-props-send.png?generation=1552408461068366\&alt=media)

**Send message**

| Property       | Options | Description                                                                                                                   |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Security       |         | When this checkbox is checked, the message is encrypted                                                                       |
| Message folder |         | This is used to select the folder from which the message will be sent (the folders are defined when the messages are defined) |

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_NpOsk0sjotPXNy29Q%2F-L_mjrxoCFlx3Q2zjX20%2F-L_mjv1zBs5WfKwU0kCw%2Fwem-modeler.nodes.realtime-props-stop.png?generation=1552408435527599\&alt=media)

**Stop listening**

| Property           | Options                            | Description                                                                                                                |
| ------------------ | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Stop listening at: | - All message - A specific message | Specify whether you want to stop listening to all messages or to a specific message (if the are multiple messages defined) |

This node has two exits:

* `Error`- this exit is used when the node produces an error;
* `Default exit`  - this exit is used when there are no errors.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wem.io/platform/wemmodeler/flowcharts/comet-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
