Forum Discussion
I’ve done something like this before. I think you’re going to need a multi-pipeline design - I don’t believe there is a way to loop within a single pipeline. The below is just one high-level design idea - there are other options.
The step1 pipeline will do the initial work, then call step2 pipeline (using Pipeline Execute) which will have the delay and check status. The step2 pipeline can have a loopback-or-continue Router snap following the status check where if the status is complete, it forks to the logic to finish the process; but if status is not complete, then it recalls step1 pipeline with Pipeline Execute. You can use parameters and Router snap in the step1 pipeline to determine whether step1 skips the initial processing and simply recalls step2 again. Parameters can also be used as a counter mechanism, so that if the counter exceeds x-number retries, then step2 fails or notifies as desired.
The Pipeline Execute documentation states that it doesn’t support redundancy (even though it works in some of my attempts), otherwise, I would recommend a design within a single pipeline. But I stick with the documentation for pipeline longevity.
No luck with that approach :). Will have to just keep at it.
- rgoerwit4 years agoNew Contributor II
So did you come up with a decent solution?
BTW, any explanation for why SnapLogic doesn’t support a simple loop flow?
- brent_vanallen4 years agoNew Contributor
I was never able to get looping to work. Even with the “callback” part of the loop separated out to a separate pipeline and using Pipeline Execute, it appears that Snaplogic can look ahead and detect if the logic in the datastream will create a potential loop…and refuses to enter the loop from the entry point (that would be looped back TO). I was able to get delay working via the suggested approach with a little Ruby script though.
We have not set it up yet but I anticipate that we will end up closing the loop logically by using a REST interface.
- rgoerwit4 years agoNew Contributor II
I’ve given my boss, who is our SnapLogic admin, information needed for an enhancement request. I am new to SnapLogic, so I hesitate to critique. I’d just say that every other ETL tool and every other usable scripting or coding language I’ve used implements loops. So it’s a shocker that SL doesn’t have this - or that you have to use nested pipelines. So I wholeheartedly encourage them to look into this.
It’s very useful to have a visual that implements a loop and shows you, nicely, what the exit condition is and what variables/fields are getting modified as one iterates. It’s possible to use recursion (pipelines). But given that we can’t click through to child pipelines or see easily what’s getting passed to them (setup of paramaters is very clicky, on both the parent and child ends) - given all this, a loop construct is really needed.
It’s also important to improve recursion and make those parameters more visible. Having to click around the parent, and the child, and having to manually ensure that everything matches, is really hard to do. And recursion is difficult for the citizen-integrators that SL targets. It’s a hard concept. If SL wants to make this easy, a simple loop will help - along with visibility improvements, as noted.