Symptom

When executing a flow from within Sugar, the end user receives an error message saying invalid_grant: Refresh token has expired. Testing the Sugar connector in the control panel of the Project Console throws the same error.


Cause

The refresh token for the connection has expired. Xpertdoc Smart Flows connects to Sugar via OAuth2 authorization.

This means that a connector is set up by a Sugar user with an administrator role who grants the Xpertdoc Smart Flows app access to the intended Sugar instance. Upon creation of that grant, the app receives an access token (by default valid for 1 hour) and a refresh token (by default valid for 14 days). Every time the access token expires, the refresh token is used to acquire new tokens. But if there is no activity before the expiry date of the refresh token, the access grant is no longer valid and the above error is thrown.


Solution

When the error occurs, reconfigure the Sugar connector in the Control Panel of the Xpertdoc Smart Flows Project Console.


To avoid this issue from happening, you can either: