Indeed, if you have multiple resources all attempting to manipulate the same file and there is no way to merge it all into a single resource as I showed, then locking in the external programs might be the best answer.
There is a possible middle-ground here, though: perhaps you could change each of the separate resources to write to a separate file and then have one final resource whose job is to collect all of those separate files and produce a merged file from them. That way you can use dependencies to specify that the merging must happen only after all of the other files have been created, but still let the individual resources run concurrently when possible.
How practical that is will of course depend on what sort of files we’re talking about and whether “merge” is a meaningful operation, but hopefully that gives you another option to consider at least.