[英]Should I use child workflow or use activity to start new workflow
Like the title.就像标题一样。 Seems like both ways should work but child workflow seems easier.似乎这两种方式都应该有效,但子工作流程似乎更容易。
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强烈建议始终使用 Activity 来启动新工作流,并且在重置功能与子工作流一起使用之前永远不要使用 ChildWorkflow https://github.com/uber/cadence/issues/3914
https://github.com/temporalio/temporal/issues/3141 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.要链接这两个工作流,请在启动新工作流时使用搜索属性。
As Quanzheng said, if you need to use Reset, then Child Workflows are not currently an option.正如全正所说,如果您需要使用 Reset,那么 Child Workflows 目前不是一个选项。
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:主要区别在于:
Whether you need either of those capabilities, and whether you use Reset, should tell you if Child Workflows are appropriate to your use-case.您是否需要这些功能中的任何一个,以及您是否使用重置,应该告诉您子工作流是否适合您的用例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.