Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

Error Handling - storing errors in multiple external calls to be able to return in the webhook response

Avatar

Level 4

Hi all,

I have a flow where I'm iterating over a list of file names that I need to get from an S3. The flow is working fine, but now I want to add better error handling and be able to return the list of files that were successfully fetched and a list of those that had errors.

I have the Iterate module, then the S3 and in the error handling I'm accumulating in a variable the names of files that fail, but in the webhook response I can't use this value.
I mean, I don't want to add a webhook response after the errors, because the flow continues, I want to be able to use the general webook response and make reference to this variable to return it in the flow response.

 

VictorToledo__0-1730488175569.png

 

i want to have something

 

response status 200

{

"errors" : ["file1", "file5"],

"success": ["file2","file3","file4]

}

 

 

thanks in advance!

 

1 Reply

Avatar

Level 5

Hi @VictorToledo_ 

 

try this: (JSON attached)

  • branch into processing files & capturing results
  • processing
    • the S3 error handler sets a "err" variable and ends in an ignore so the processing continues
    • after getting the err msg we check
      • is error: create a JSON string {"file":"#####","error":"####"}
      • no error: just collect the file name {"file":"#####"}, use comma as separator
      • set the variable of the aggregated strings
  • capture results
    • simple getVar > stuff into webhookResponse.

 

SveniX_0-1730492036892.png