I’ve got a scenario that accepts a webhook with a payload of an array of objects, and it uses these to create invoices in Quickbooks. I am returning a success webhook response or an error one if there is a QB error.
I’m trying to gracefully handle a situation where some of the objects result in successful invoices, but then some fail. I guess Make is doing a complete execution of the scenario for each object in my array, but leaving off the webhook responses until all objects are processed? Because I only get one response, whether I have a single invoice or multiple. I’m thinking I need some kind of Text Aggregator to build up a status message that can eventually be passed back with the response.
I’m thinking I could return something like:
{
"results": [
{
"id": 1,
"status": "success"
},
{
"id": 2,
"status": "success"
},
{
"id": 3,
"status": "fail",
"message": "Duplicate Invoice Number"
}
]
}