How do you send signals from an activity to it's parent workflow?

Hi there, I have a workflow that creates an activity that polls another service for status. I also currently stream workflow history events so that the operator running the workflow can see where the workflow is progressing via some custom built tooling.

I would like for this activity to be able to send back the statuses its receiving from the service it’s polling, and for these statuses to be able to be shown to the operator via the workflow event history stream.

I think the way to do this is for the activity to send a signal to the workflow in a fixed interval with the latest poll status, which I believe would register as an HistoryEvent_WorkflowExecutionSignaledEventAttributes and should show up in the history event stream for the operator.

My questions:

  1. Is this approach reasonable/is there a better way to go about this? The workflow history event stream is the preferred UX for the operator, and so the solution must be to add this status info to the history stream.
  2. How does an activity send a signal to it’s parent workflow?

I’m using the Go SDK. Thanks in advance for your advice.

I would recommend against this approach. Workflow history is intended for workflow recovery and not as a notification log.

For your use case, I would include the status into the activity heartbeat. Then, use the DescribeWorkflowExecution call to get that data from the pending activity info.

1 Like