# Modelling temporal workflows for websockets and event streaming

**URL:** <https://community.temporal.io/t/modelling-temporal-workflows-for-websockets-and-event-streaming/2988>\
**Category:** Community Support\
**Tags:** workflow-options\
**Created:** [September 21, 2021, 4:01pm UTC](https://community.temporal.io/t/modelling-temporal-workflows-for-websockets-and-event-streaming/2988 "2021-09-21T16:01:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkatre](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nkatre](https://community.temporal.io/u/nkatre)\
**Post date:** [September 21, 2021, 4:01pm UTC](https://community.temporal.io/t/modelling-temporal-workflows-for-websockets-and-event-streaming/2988/1 "2021-09-21T16:01:05Z")

</div>

Is there a best practice to follow when modelling temporal workflows to listen to websocket events ? My use case is to listen to websocket events and do some processing for specific event types.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [September 21, 2021, 5:34pm UTC](https://community.temporal.io/t/modelling-temporal-workflows-for-websockets-and-event-streaming/2988/2 "2021-09-21T17:34:58Z")

</div>

When a WebSocket receives a request it maps it to a signal to a workflow. When workflow wants to push any data as a reply it does it from an activity.

---

<div class="post-metadata">

**Author:** ![nkatre](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nkatre](https://community.temporal.io/u/nkatre)\
**Post date:** [September 21, 2021, 5:38pm UTC](https://community.temporal.io/t/modelling-temporal-workflows-for-websockets-and-event-streaming/2988/3 "2021-09-21T17:38:03Z")

</div>

thanks @maxim for the reply. Where should the logic to listen to web socket events actually live ?

- Should this listener logic be a different workflow which signals the main workflow for processing events ?
- Or should the listener be a separate process which listens and signals the main workflow to process the events ?
- Or is there a recommended approach where the listener should live ?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [September 21, 2021, 5:39pm UTC](https://community.temporal.io/t/modelling-temporal-workflows-for-websockets-and-event-streaming/2988/4 "2021-09-21T17:39:39Z")

</div>

It should be a separate listener that signals the workflow.
