what is the use of return document in process call?
The return document is placed at the end of the document path. It returns the document to the parent process.
What are you trying to do exactly?
Basically the Return documents shape is used as the last shape in the calling sub process to return the processed documents to the called parent process. You can think of this shape as a data exchange between 2 processes.
There is extensive documentation on return shape in the help docs. Please go through this and let us know, if you still have questions: Return Documentsshape example
Return Document which will return the data into the parent process which is placed at the end of the child process and it is mainly used in the process call.
You can use the return document to return the response from sub process to main process.
Also it can be use in listener process to return back the response example -for Queue Listener process or Web service server process
Suppose you have multiple paths in your sub-process, yet all of the documents need to be combined afterwards. Once the documents hit the return documents store, they will all be available on the same path on the calling process. This would allow you to easily combine them all after the sub process.
We also commonly use a Return Documents shape at the very end of a process (and give it a pertinent label) which shows up as a "tile" to view documents easily in process reporting. For example, I could label a Return Documents as "Not sent to SFDC" and would have a quick way of viewing how many records were rejected.
Also it is very much used while validations on the data, where you want to start with the same data set after it passed all the validations.
Lots of good info in this thread.
You may also be interested in 4 (Good) Reasons to Use the Process Call Step
Thanks to everyone for saying me about return document
Retrieving data ...