How to Handle Errors Gracefully from the Salesforce Find Records Component?

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

Does anyone have a way to handle errors gracefully from the Salesforce find records component? Someone updated a value from within Salesforce which forced the workflow to fail. I might have to use nodejs instead if there’s no way to handle those errors gracefully

Hi , do you mean there’s a built-in Salesforce action failing and exiting the workflow?
If so, currently we don’t support error handling for built-in actions. This is in scope for Control Flow

Yes, so I have the Salesforce component in the flow, it asks you to enter which fields you want to select. One of those fields was changed by another person in our account which caused the workflow to fail due to the field not existing anymore

Could you file a support ticket at Support - Pipedream so I can take a look at your workflow and the error?

The error was just a “Field not found” error, but the bigger thing I’m wanting to accomplish is just to have a way to return something else gracefully when it errors out

I can definitely still fill out a ticket though

I want to take a look at the workflow to see if I can suggest anything, you can share the workflow URL here instead of filing a support ticket

I looked into your workflow and found some INVALID_FIELD errors in your event history

So the only way to treat that error without exiting the workflow is to modify our existing action and publishing it privately to your workspace

try {
    const response = await this.salesForceRestApi.getRecords(
      sobjectType, {
        fields: Array.isArray(fields) && fields.join(",") || fields,
        ids: Array.isArray(ids) && ids.join(",") || ids,
      },
    );
    if (response) {
      $.export("$summary", "Record found successfully");
    }
    return response;
} catch (e) {
    console.log("error")
}

Are you familiar with this process? You’ll have to clone our repo locally, and then publish the modified version using our CLI. Here’s some additional docs: Overview - Pipedream

Thank you. I will look into this