HTTP Response Fails Workflow Execution

I need to enable emails when a HTTP Response is a non-202. For testing, I am forcing my endpoint to return a 401 Client Unauthorized (my client ID/secret is purposely wrong) and send an email if a condition check of the status is not 202 then it should send an email:

However, the workflow fails as soon as the HTTP Request fails and does not proceed to the next step of Compare Number:

type timestamp attributes
WorkflowExecutionStarted 2022-11-02T01:18:09.684310093Z {input:{sourceId:2c91808a80aed5400180d2819c453b89,identityName:_test-IdentityNow10,nativeIdentifier:OOZ00000009G010,identityId:2c9180867e8cffdd017e8f8fdb1f241f,_meta:{triggerType:FIRE_AND_FORGET,subscriptionId:b33205cf-1e2a-4fb7-9c3a-c19760bc3d8a,invocationId:9ccc660c-d12e-48f0-9d71-5a994629c122},attributes:{study_name:982345 IGA,lastName:TestADLN10,SnowflakeStudyTeam:{\id: \OOZ00000009G010,\level: \study_level__v,\studyId: \0ST00000006A007,\roleId: \0TR000000000804,\personId: \V0B000000067004,\personType: \internal__c,\status: \active__v,\obsolete: false,\grantRelatedRecord: true,\creationTimestamp: \2022-08-01T09:45:38,\lastUpdatedTimestamp: \2022-11-02T01:17:42},name__v:TestADFN10 TestADLN10,employeeStatus:active_state__v,studypersoncreationTimestamp:2022-09-27T19:05:25.000Z,study_ppd_external_id__c:RTST117101,user__v:13736839,grantRelatedRecord:true,creationTimestamp:2022-08-01T09:45:38.000Z,id:[OOZ00000009G010],idNowDescription:e2c7cfaa21c0f8fc1f137ae39cd6d5d61131cfd052ab8d17e71a69d17f0c421b,study__clin:[0ST00000006A007],lastUpdatedTimestamp:2022-11-02T01:17:42.000Z,person_type_picklist__c:[internal__c],email__clin:[email protected],team_role__v:[0TR000000000804],role_name:Study Viewer - Unblinded Content,firstName:TestADFN10,study_team_role_level__c:[study_level__v],state__v:active_state__c,obsolete__c:false,person__clin:V0B000000067004,ppdDisplayName:TestADFN10 TestADLN10
ActivityTaskScheduled 2022-11-02T01:18:09.794277052Z {displayName:Wait,input:{date:null,duration:1m,time:null,type:waitFor},stepName:wait,task:sp:sleep}
ActivityTaskStarted 2022-11-02T01:18:09.818161685Z {displayName:Wait,stepName:wait,task:sp:sleep}
ActivityTaskCompleted 2022-11-02T01:19:09.865843906Z {displayName:Wait,result:{},stepName:wait,task:sp:sleep}
ActivityTaskScheduled 2022-11-02T01:19:09.920911179Z {displayName:HTTP Request,input:{authenticationType:null,basicAuthPassword:null,basicAuthUserName:null,csvRequestBody:null,formRequestBody:null,headerAuthName:null,headerAuthValue:null,jsonRequestBody:null,method:put,oAuthClientId:null,oAuthClientSecret:null,oAuthCredentialLocation:null,oAuthScope:null,oAuthTokenUrl:null,requestContentType:text,requestHeaders:x-client-name:iga-dev\nx-client-id:e974f515bd6e4cbaa788dfb039f4692b0\nx-client-secret:065aeaa0bAfd4d70AbBFCcEB4AB882e8\nAccept:application/json,textRequestBody:{\id: \OOZ00000009G010,\level: \study_level__v,\studyId: \0ST00000006A007,\roleId: \0TR000000000804,\personId: \V0B000000067004,\personType: \internal__c,\status: \active__v,\obsolete: false,\grantRelatedRecord: true,\creationTimestamp: \2022-08-01T09:45:38,\lastUpdatedTimestamp: \2022-11-02T01:17:42},url:http://edata-dev-exp-veeva-auth-api-v1.us-e2.cloudhub.io/api/study/teams,urlParams:null},stepName:hTTPRequest,task:sp:http}
ActivityTaskStarted 2022-11-02T01:19:09.94530756Z {displayName:HTTP Request,stepName:hTTPRequest,task:sp:http}
ActivityTaskFailed 2022-11-02T01:19:10.093592467Z {displayName:HTTP Request,error:request failed,stepName:hTTPRequest,task:sp:http}
WorkflowExecutionFailed 2022-11-02T01:19:10.145248185Z {error:task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@87c5234c539a@): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {\n \error: \Invalid Client\n}}

Thanks,

Daniel

Hi Daniel. Thanks for bringing this to our attention. If I may ask, what is the intention of the email message that you want to send on non 2xx response? Is it to alert an admin that the workflow failed, or something else?

Exactly, to alert when a workflow fails. It would be nice to have an email stating why it failed, which we can do within the workflow itself. If there is another way to do it outside of the actual workflow I can explore that too.

Just spitballing some ideas. Would it be helpful to have a workflow configuration to specify which email addresses to send an error message to if any part of the workflow fails? Or do you prefer to have granular control within the workflow to pick and choose which potential errors to send an email for?

Our minimum requirement would just be to get an email when a workflow fails. Of course it would be great to have that granular control.

So it sounds like there is no solution at the moment?

At this time, a non 2xx response from the HTTP action will fail the workflow at that spot, so no way to capture the response code and send an email based on it. However, I have submitted this idea to our product team for them to look into it.

Hi Colin, has this idea gotten any traction?

This issue of an HTTP action failing the whole workflow severely limits the action’s capability. Ideally if the workflow HTTP action receives a JSON based error message back one would expect the response to be parse-able to allow for graceful handling.

Are there any suggested workarounds?

Hi @RTASB. This idea is still in the backlog, and there aren’t any workarounds at this time.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.