How to pass data between nodes in a workflow and use it in a Decision controller ? #142
-
|
Hi, I'm trying to build a workflow that checks the current day of the week and uses a Decision controller to branch accordingly (e.g. run different jobs on weekdays vs. Sunday). Then use a Decision controller with the expression input.data.day == 7 to check if it's Sunday. However, the expression always evaluates to false, even though the job completes successfully and outputs the correct JSON. Looking at the Expression Builder, the data appears to remain in the output field as a raw string rather than being parsed and made available under input.data. I also tried enabling "Interpret JSON in Output" in the Shell Plugin settings, but the behavior is the same. I also tried using new Date().getDay() == 0 directly in the Decision controller without any preceding job, but JEXL doesn't seem to support the new keyword. Am I missing something? What is the correct way to pass structured data from a Shell Plugin job to a Decision controller in a workflow? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
So sorry for the confusion. When you output JSON for xyOps to read, you need to include a top-level echo '{"xy":1,"complete":1,"data":{"day":'$DAY'}}' |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the quick answer :) It works perfectly ! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

So sorry for the confusion. When you output JSON for xyOps to read, you need to include a top-level
xyproperty set to1. This is how xyOps knows to consume the JSON and interpret it. Otherwise it just passes it through. This should do the trick: