Receive a workflow signal from a client

Hello there !

I’m trying to wrap my mind around the Signal mechanisms.

So I have this situation : I have a CLI client that can start a workflow on a worker to listen to some external events coming randomly, possibly saving them and most importantly giving them to any internal listener.

In the past, I was using a pubsub tech to do the last part, I was wondering if there was any possibility to do this on Temporal: workflow send signal and anyone listening can catch it, even the CLI.

Do you think it’s possible ? I’ve seen the client-to-workflow and the workflow-to-workflow but not the workflow-to-client(s). I’ll continue navigating the doc for this.

Thank you :slight_smile:

Edit: Or maybe should I use Updates from clients and let the workflow answer when it has a new event, letting the clients do a new update to get the next events.

Signal is one way, and the target is always a workflow.

CLI emitting an update and waiting for it to return is the way to go.

In the long term, we might offer another mechanism that allows waiting for a workflow to reach some state without adding events to the history.

Perfect, I’ll look toward that ! Thank you very much :slight_smile: