I am assuming you are not using any custom publishing action and using OOTB auto publish implemented via Sitecore.Workflows.Simple.PublishAction, Sitecore.Kernel
.
This publish action uses the below parameters -
- Item = The item to publish, where workflow action is being used
- targets = Target database/s
- languages = The languages, an item needs to publish
- deep = controls whether children of the current item will be published. Possible values: "1" - children of the current item will be published; all other values - children of the current item will not be published.
- compareRevisions = Compare revisions if set to 1
- publishRelatedItems = Publish related items if set to 1
If you will see the code of simple publish action, innerItem's parameters are converted into NameValueCollection
to get each param -
NameValueCollection urlParameters = WebUtil.ParseUrlParameters(innerItem["parameters"]);
bool deep = this.GetDeep(urlParameters, innerItem);
bool related = this.GetRelated(urlParameters, innerItem);
Database[] array1 = this.GetTargets(urlParameters, innerItem, dataItem).ToArray<Database>();
Language[] array2 = this.GetLanguages(urlParameters, innerItem, dataItem).ToArray<Language>();
bool compareRevisions = this.IsCompareRevision(urlParameters, innerItem);
But if the child items are not in the final workflow state these will not publish, all you need to add some custom action to programmatically approve the child items and put them in the final workflow state and publish.