Using ActiveCampain work flows, I have a pipeline in which I want to execute code conditionally based on the output of a jq command.
For example, I want to execute and !http
and !jq
command if .status == "event-created"
.
JSON
{
"id":1,
"firstname": "Nj",
"lastname": "Bhanushali",
"email": "test@test.com",
"title":"Call with new lead",
"status":"event-created"
}
Code
"!pipe": [
{
"!jq": ".status"
},
//call this jq if .status == "event-created"
{
"!http": {
"method": "GET",
"path": "/contact/fields"
}
},
{
"!jq": "${piped_content::1}"
},
]