Summary:Workflows failing intermittently on Query User Profile or Update User Profile actions
Product:Workflow for SharePoint 2013
Symptom:Workflows failure on User Profiles action
Cause:Timeout when querying User Profile database is causing this intermittence
To workaround the timeout issue, you can add a 5-minute pause after the 'User Profiles' action.
There are also other options that can be utilized within the SP as explained below.
1) To run a maintenance on their User Profile database: https://technet.microsoft.com/en-gb/library/ff681014.aspx
2) Increate timeout in User Profile service application: http://blogs.technet.com/b/jay/archive/2013/07/16/unable-to-populate-ad-containers-while-creating-a-new-ad-sync-connection-it-times-out-or-do-not-respond.aspx