2

We have this custom activity in my Journey and we do a validation of these contacts on our side. If the contact validation failed on the custom activity journey, we want it to stop the journey of that specific contact but still continue with the other contacts.

The scenario is like when you add an outArguments in your config.json but you did not provide it on the response from the server. But we do not want to put an outArguments.

We've tried to return 400 and 500 but still the contact has a Success status instead of Hard Error. We want to put it on a Hard Error or Soft Error status instead of Success status for that specific contact. How can we do that?

2
  • couldn't your activity be a decision split and if they don't meet a condition they go down a path which exits the journey?
    – EazyE
    Jul 2 '21 at 14:45
  • I can’t do that, the decision has to be made within our server. We need to validate some data against our data. Jul 4 '21 at 4:42
0

You can remove up to 50 contacts per batch by calling this endpoint when your custom activity identifies that a contact failed the validation.

Or as @EazyE mentioned in the comment, utilize UI solutions like Decision Splits or Exit Criteria to remove a contact from the Journey, yet this approach considers that you would be able to set the same filtering rules as you have in your custom solution but in UI.

Hopefully, it would help.

1
  • We don’t want to remove the contact from the list. We just don’t want them to proceed. Jul 4 '21 at 4:43
0

I have implemented custom push activity and had similar requirement. For a contact with bad data, I used to send 400 statuscode. And for any internal server errors /.etc, I used to send 500.

400 -> Continue to evaluate the same contact for next activity. However in JB it shows as Success. I feel it should go as soft error and wondering what could be the statuscode soft error😅

500 -> JB does a retry as specified in config.json and after last retry if it's 500 still, it removes that contact from Journey. I used Azure function for Execute API's and Here is the response returned: Check explicitly sending 'Content-Type': 'application/json'

context.res = {
   headers: {
     'Content-Type': 'application/json'
   },
   status: 500,
   body: {
             "correlationId": correlationId,
             "errorMessage": errorMessage
         }
};

PFB screenshot.

enter image description here

2
  • I tried this approach but I am using .net core API for my execute function. I returned StatusCode 500 if I get an exception. I also added "Content-Type" header on my response context with "application/json" value but still I get a Success status on that Entry. Dec 10 '21 at 11:18
  • just to cross verify, log the jwt request payload and hit execute api from postman. And then can you confirm the status code. BTW, Are you doing something like below ? stackoverflow.com/questions/37793418/… Dec 24 '21 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.