Catching and Redirecting Errors from Native Connectors/Actions in Workflows

This topic was automatically generated from Slack. You can find the original thread here.

Hi all, when using any native connector/action and it throws an error…. Is there a way to receive that error and possibly send it elsewhere….?

Usually, any error from a native connector/action ends the WF, but I want to catch this error in a $.respond() to send back to the client that requested.

Is there a way to make this work?

Appreciate any help. Thanks

Good question - so we’re working on a centralized Event Histories dashboard so you can view all of your errors in one place within the dashboard.

I’m not sure if the $error channel will subscribe to source errors as well, I’ll find that out.

If it does, then you can use this tutorial to set up a subscription to emit errors to any service:

But if not, then you might need to fork the source, and add your own logging.

Thanks for the response Pierce,

In my use case, when I call an endpoint, a HubSpot create company action runs… I want to get a response of the action but on an error, the WF stops and the $.respond doesn’t reply with a useful msg. I thought about the error subscription too but how do I keep the session open or redirect the error subscription to the session.

Can you clarify what you mean by a session specifically?

I tried to capture it here…. By session, I mean when a client calls a webhook/endpoint that is configured to reply with a custom response…

Thanks for the graphic, much easier to understand. Have you tried to wrap your Hubspot API call with a try..catch and handling the $.respond case in the catch in case Hubspot rejects or fails the request?

You could also log the error in that catch as well

That’s the thing… I’m not using the HubSpot API call…

I’m using this

Yes, that’s a limitation of using a pre-built step.

We don’t have custom error handling for pre-built actions yet, but you can either fork that component and publish a version that includes this custom logic you need with the error handling.

Alternatively, you can use the Node.js scaffolding with Hubspot to recreate the API call to create the company.

Got it… Wanted to be sure there was no way to get the error with the prebuilt steps…

Thanks

I have a follow up question if that’s ok to something related on the same project

We have a custom source that will emit rows of a CSV as events to specified WFs…

Thing is the CSV could have about 20000 rows which means 20000 events… The documents say the queue can only handle 10000 events… without being able to throttle the custom source emission, what happens to the remaining 10000 events?

Yes on the Advanced plan the Event Queue limit is 10,000 events.

You can either upgrade to the Business plan which includes 25,000 events in the queue, or the Enterprise plan offers even higher limits if needed.

If the event queue is overloaded, it will ignore new events attempted to be added to the queue

Does using a service like a message queue work here?

We don’t officially support that, but you’re welcome to try!

You have Qstash