Hi,
I have been working with GitHub - berndruecker/trip-booking-saga-serverless: Standard example of the Saga pattern (trip booking) in a serverless world and trying to get it to work on Camunda Cloud and GCP (using google cloud functions).
I have a cluster running and everything setup correctly.
I have followed every step from your writeup, and everything works as expected EXCEPT the failure conditions, namely, cancelHotel, cancelCar and cancelFlight.
Followed instructions and initiated using:
curl -H "Content-Type: application/json" -X PUT -d @request-zeebe.json https://us-central1-servicemeshes-poc.cloudfunctions.net/bookTrip
I confirmed that the JSON payload is sent over by the initiator function bookTrip:
{
âbookHotelFailureâ : âtrueâ,
âbookCarFailureâ : âtrueâ,
âbookFlightFailureâ: âfalseâ
}
I confirmed in the cloud function logs.
This shows up as âvariablesâ at the root level, but amazingly, this payload is NOT sent over to any of the ServiceTasks! And since the bookHotelFailure is undefined in the code:
module.exports.bookCar = (req, res) => {
const body = req.body;
let responseBody;
console.log('carfailure: ' + body.bookCarFailure)
if (**body.bookCarFailure && body.bookCarFailure==='true'**) {
console.log('simulated failure to book a car');
responseBody = JSON.stringify({
success: false,
carMessage: 'Car booking went wrong because we wanted it to fail'
});
} else {
console.log('booked a car');
responseBody = JSON.stringify({
success: true,
carMessage: 'Car booking successful'
});
}
res.status(200).send( responseBody );
};
I confirmed that the payload received by the Cloud function is undefined. Therefore,
all service tasks simply complete with success = true.
Basically, I am unable to get the payload to pass over from the root scope to any job worker
What might be the reason for the payload getting sent to the workflow instance, but not getting propagated over to the Service Task!