Child Workflow creation . .

I’d like to be able to create 1,000+ child-workflows. It looks like you can only create child workflows from within the workflow thread. Ideally, I’d like to create the child from within an activity, as that way, the workflows can be created in a reliable/managed way. Now, an option is to create non-child workflows from within the activity, but then they wouldn’t have a parent, and wouldn’t honor cancel/termination semantics.

Any suggestions? Thanks!

Sean

We recommend creating child workflows from workflow. It is the most reliable way. Why do you think that starting them from an activity is more reliable?

Urgh, I remember now. Creating child workflows is just going to create an event that will get returned embedded in the decision task response. So yeah, my concern about reliability isn’t founded. The only challenges would be (i) exceedingly response message size (I’m aware of that one – I can split the workflow if necessary) and (ii) the amount of time it takes the server to process the response (which can be managed by adjusting the timeout).

I would recommend not passing large responses through the workflow. Temporal is an orchestration engine, not a big data processing one. The usual workaround is to store large data in some external store like S3 and pass references to it through the workflow. Another option is to cache this data on a host and route all related activities to that host.

We’re not using big data, just a massive orchestration use-case. I think I might email. :slight_smile:

Make sure to bound the number of child workflows per workflow run. 1k is OK, but much more would require some care. One approach is to use hierarchy. For example a single parent with 1k children each starting 1k children gives 1 million children.