Salesforce connection fails after success

Bishop, Mike S 11 Reputation points
2020-08-04T17:57:53.7+00:00

We have logic apps that use a Salesforce API connector. The logic app runs good for a few times, but fails after a few runs with a 401 error. The logic app runs 2x per day. It seems to fail on the 3rd attempt.

This is the error:
{
"status": 401,
"message": "Salesforce failed to complete task: Message: This session is not valid for use with the REST API\r\nclientRequestId: d22d5dbe-ccfb-487b-8116-843f8e59db9e",
"error": null,
"source": "Salesforce.Common",
"errors": []
}

Run schedule:
15556-image.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
{count} votes

2 answers

Sort by: Most helpful
  1. svijay-MSFT 5,256 Reputation points Microsoft Employee Moderator
    2020-08-05T14:07:32.027+00:00

    Hello @Bishop, Mike S ,

    One quick observation - The Logic App is failing after certain period of time for successive request - as per screen shot > 12 hours. I am assuming that you are signing in again in order to rectify the error.

    Logic App getting INVALID_SESSION_ID from Salesforce - usually indicates on a token / session expiration that is set in the Salesforce environment. (Or IP Restriction in some cases - but may not be your case as it works for certain amount of time) . There are few configuration that can be set up at the Salesforce end which can expire the access token (as well as the refresh token).

    I would recommend you to check for the session restrictions. Attaching image for your reference. Managed to get some screenshots from internet but may actually vary at your environment.

    15834-image.png

    15835-image.png

    1 person found this answer helpful.
    0 comments No comments

  2. Fuster, Beatriz 1 Reputation point
    2020-12-11T13:43:53.233+00:00

    Hi!
    I'm facing the same issue after IT set the 2h timeout for the salesforce tool. The configuration is not at user level so it would be really difficult to disable it back only because of few using the PowerAutomate.
    Any way to get a workaround to solve this?
    Thanks!

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.