2

Like the title. Seems like both ways should work but child workflow seems easier.

Sharan Foga
  • 135
  • 8
Long Quanzheng
  • 2,076
  • 1
  • 10
  • 22

2 Answers2

2

It’s strongly recommended to always use activity to start new workflow and never use ChildWorkflow until the reset feature is working with Child Workflow https://github.com/uber/cadence/issues/3914

https://github.com/temporalio/temporal/issues/3141

To get result back to parent from child workflow, use signal. To link the two workflows, use search attributes when starting new workflows.

Long Quanzheng
  • 2,076
  • 1
  • 10
  • 22
1

As Quanzheng said, if you need to use Reset, then Child Workflows are not currently an option.

Apart from that issue, the semantics of Child Workflows are quite different from starting a new workflow via an Activity.

The primary differences are that:

  1. By default, Terminations and Cancellations are propagated to Child Workflows, although this can be overridden at Child Workflow creation time. This behavior is possible to implement with co-equal Workflows, but requires a careful Workflow implementation which never terminates without terminating its children.
  2. Waiting for a Child Workflow to complete is directly supported in the Temporal API, whereas waiting for an arbitrary Workflow is not. See this issue.

Whether you need either of those capabilities, and whether you use Reset, should tell you if Child Workflows are appropriate to your use-case.