How to know child workflow status(Workflow Events)


When using await startChild, how can I subscribe to or monitor the events of the child workflow?

Additionally, how can I achieve the same for the root workflow from an external module for listening or subscribing?

The child workflow can send signals to the parent or any of its ancestors. What is the use case for "events monitoring’? If it is just for external visibility I would recommend querying the child directly.

For signals,
If I understand correctly, I’m gonna use setHandler for parent and for child I will define await childHandle.signal('anySignal');

My other purpose is, how can I reactively get workflow events.

Listen if new workflow started, closed etc.
Listen for that workflow events

I use setInterval for now

listResponse = await connection.workflowService.listWorkflowExecutions({
      namespace: 'default',
      query: `WorkflowId = "${workflowId}" and ExecutionStatus = "Running"`,

The child would define parentHandle.signal(...).

What is the purpose of getting child workflow events by the parent.

I don’t think you want to use listWorklfowExecution as part of your workflow logic. It is eventually consistent and cannot scale out the way workflows do.

Ofcource, What should I use instead?

It is hard to give recommendations without understanding your specific use case and its requirements.