Tail snap and documents

Hello Snaplogic Community

We have a pipeline that has a JSON generator acting as a loop with some dates as input into the first pipeline execute and we need to have the loop entirely finished before calling the second pipeline execute but the tail snap with number of documents set to 1 presently calls the second pipeline execute even before the “loop” finishes executing.

How can this be achieved??? Should the tail snap be set to the no of documents from the JSON generator? Thank you very much in advance.

My suggestion rather than using tail snap use Group By N snap and keep the Group Size as 0. It will wait for all the documents which are processing in first pipeline and then you can map your object after Group By N something like $group.Date etc… and call the second process.

I also use the Tail Snap to control the flow of the execution. Please share the setting of the second Pipeline Execute Snap. Do you have the “reuse” on? If so, the pipeline will start as soon as the main pipeline starts, but if the “reuse” is off, it should start when there is an input document getting into the Snap.