cancel
Showing results for 
Search instead for 
Did you mean: 

How to replicate the logic equivalent to while loop in Snaplogic pipelines

MuraliNagula
New Contributor

There is a child pipeline which returns values like completed, in queue, processing etc. The requirement is that parent pipeline to run this child pipeline till it returns Completed, of-course after certain wait time. Its like while loop, run the child pipeline, till the expression is true. How do accomplish this in snaplogic ?

Appreciate any pointers…

14 REPLIES 14

All these are REST API Get/POST jobs

What do you mean by “queue up” here? Is the queue in an external service and the children are pulling from there? Maybe I’m misunderstanding.

I guess I would expect the parent pipeline to pull from the queue and let the PipelineExecute snap distribute documents to child executions.

Sorry, I’m having trouble visualizing the parent and child pipelines here. Would you be able to attach a screenshot of them or an SLP export?

Yes. Its external (Marketo) service.Parent submits a bulk job and in the response object we get a exportID. We have to keep checking the status (REST Get Call to Marketo) of this export job thru another Marketo endpoint which happens in a child pipeline. This child pipeline should be running in while loop kind of thing till we get a success/failure response. Picture of child pipeline attached.

49%20PM

psadasivam
New Contributor III

@MuraliNagula - This can be achieved using "Has next "and “Next URL” properties. Below rest snap invokes Next URL based on Has next flag. You can refer Snap documentation for more info.

image

I just wanted to add on that you should set the ‘Pagination interval’ as well so that the requests aren’t made too quickly.