Forum Discussion
14 Replies
- christwrContributor III
I’ve seen people suggest creating a Triggered Task for the child pipeline, and then have the parent pipeline call the child pipeline via REST GET snap and use the REST GET snap’s “Has Next” and “Next URL” capabilities (typically for paging) to do a while loop. The child pipeline has to return something that the parent “Has Next” can evaluate.
- MuraliNagulaNew Contributor
How and where do set these “Has Next” and “Next URL” in the triggered task ?
- tstackFormer Employee
Can you explain what processing you’re doing? Maybe focus less on the mechanics so that we can understand the use case.
- MuraliNagulaNew Contributor
The parent pipeline queues up a bulk job to export records. The child pipeline keeps getting the status of the job every 60 seconds to get the status till it reaches its end state. I have tried to put everything in the parent pipeline but looks like child pipeline is the best way to go.
- MuraliNagulaNew Contributor
All these are REST API Get/POST jobs
- psadasivamNew 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.
- tstackFormer Employee
I just wanted to add on that you should set the ‘Pagination interval’ as well so that the requests aren’t made too quickly.
- MuraliNagulaNew Contributor
Unfortunately the response object for this Marketo Endpoint doesn’t have “Has Next” or “Next URL” attributes. Otheriwse my life would have been much easier !!!
You can find the details of the response object etc in the following link.
GET /bulk/v1/leads/export/{exportId}/status.json
- tstackFormer Employee
The “next” properties are expressions. So, I would think you could write an expression to check the response to the status request to see if it was completed or not. If it was completed, the ‘Has Next’ expression should return false, otherwise it should return true. The ‘Next URL’ can just be the same as the main Service URL property.
- cstewartFormer Employee
In the documentation for the REST Get Snap, there is an example for response form marketo:
REST Get Pagination: Marketo
For Marketo, set:Has Next: resultdoc.moreResult
Next URL: “/rest/v1/activities.json?nextPageToken=” + resultdoc.nextPageToken + ”&activityTypeIds=1&activityTypeIds=12”- MuraliNagulaNew Contributor
The difference is rest vs. bulk call.
- christwrContributor III
The API for the child triggered task doesn’t have to return “Has Next” or “Next URL” properties directly, just something you can evaluate in expressions for those attributes in the REST GET snap.
For example:
Or whatever type of expression that returns true/false based on whether you want the REST GET snap to do again…