cancel
Showing results for 
Search instead for 
Did you mean: 

Can we pass the "pipe" object as a parameter to a child pipeline?

mmussitsch
New Contributor II

I’m using this for an error handler.
The executing pipeline hits an error that sends it to the error pipeline.
The error pipeline writes the details to a db table or flatfile. I was hoping I wouldn’t have to send all the pipe details as parameters individually from all pipelines that use this and could reference just the object.
I could see an option to write the details to a file that gets read in, but that also seems clunky.

I apologize if this is basic and has been discussed but my search didn’t pull anything back.

Melissa

2 REPLIES 2

j_angelevski
Contributor III

Hi @mmussitsch,

Yes ! You can absolutely pass the whole pipe object to the child pipeline form the parent pipeline. In your parent pipeline, with the Pipeline Execute snap you can pass a parameter for example pipeObject:
image
Once you pass the pipe object to your child pipeline, you can parse the JSON string with the JSON.parse() method and then you can access any pipe attribute you need.
image
For example:

JSON.parse(_pipeObject).label

Will give you the label of your parent pipeline. To see all properties, you can just map the whole pipeObject parameter JSON.parse(_pipeObject).

Thank you!
I swear I tried this, but it’s that dang ‘=’ sign that burns me more often than not. I didn’t send it properly and instead was treating it as a string.