I would like my workflows to subscribe to some service and periodically be fed data by it. Is a signal used for that?
How would I implement this pattern in temporal?
2 examples:
I want my workflow to send a slack message through an activity and then receive the user’s response. E.g send a slack block containing 2 buttons ‘yes’ ‘no’ to a slack channel and then receive the answer back in the workflow through a webhook service.
I want my workflow to subscribe to some topic on another service through an activity and then receive data from that topic. Then another activity would unsubscribe from that topic when my workflow ends.
Yes. You set up your webhook handler outside of Temporal, such as by using an AWS lambda function, or whatever is convenient for you. Your webhook handler would then use the Temporal client library to send a signal to your workflow.
How do you receive data using that API? Does it also send you the data that you’ve subscribed to through a webhook?