Conditional Calling

Hi,

Is there any option where we can execute 2 dependent pipelines One after the Other.

E.g :

  1. Pipeline X1 executes a series of Snaps.
  2. Execute Pipeline X2 only if X1 is Succesfull.

Also,
Can i set up both X1 and X2 in the same pipeline ?

Have you tried using a master pipeline with 2 PipelineExecute snaps, one X1 and one for X2?

No,
Currently the design is Snap1 followed by Snap 2…etc at end in a pipeline Execute(X1 till here) which call X2.

I can put 2 different Pipeline executes in a Master pipeline provided they can execute one after the other.

yes, you can setup both in one pipeline. all you need is an Aggregate snap in between X1 and X2. This will force all processing is completed before initiating X2. There is a catch with this where you won’t be able to pass through any data from X1.

Will that work for you?

what would be the aggregation i should use.?

I tried using Aggregator, though i dont need any data to be passed to X2 , the X2 snaps getting executed before completion of X1 snaps.

Most snaps won’t do any work until they receive a document to process. So, for cases where you need to execute things in order, you need to control the flow of the documents. In this case, you would have one PipelineExecute for X1 that was connected to the PipelineExecute for X2. When X1 finishes, the PipeExec snap will write a document to its output view and that will cause the downstream PipeExec to start X2. (Note that X1 should not have any unlinked output views since the documents that flow out of there will come out of the PipeExec output view.)

Alternatively, if you wanted to put all the snaps in the same pipeline, you can do like @aleung suggested and use an Aggregate or Tail snap to control the flow. These snaps won’t output a document until their upstream snaps have finished. So, that will ensure the ordering.

1 Like