using External Service with the Custom Activity
I have a long running custom activity and tasks related to this activity are handled by the custom external service registered with the runtime.
The mechanism adopted to realize this
a) The external service Enqueues the Workflow Queue once the Task is done.
b) The custom activity subscribes for notifications from the Queue via queue.RegisterForQueueItemAvailable
c) Once the notification is received, The data is dequeued from the workflow Queue and subsequently the custom activity unsubscribes from the queue and deletes the Queu and invokes CloseActivity on the ExecutionContext
This mechanism seems to work quite well
I now have a need to add an additional activity along with the first one which also performs long running Task. I wanted to reuse the same instance of the custom external service to perform the second task instead of registering another instance of the custom service with the runtime.
That would mean, when the first activity receives notifications via IActivityEventListener.OnEvent, that data is enqueued in the Workflow Queue, the activity instead of unsubscribing and deleting the Queue, should check if there are any
activities that are yet to be executed. If there are none, the Queue can be unsubscribed from anf then deleted.
I would like to know if there are ways where a specific activity can be aware of other activities that are yet to be executed in the workflow instance and then perform certain actions accordingly
please also comment on this approach. Any other suggestions would be welcome

