An unhandled exception occurred during the execution of the workflow instance

SharePoint visual studio workflow is very much useful. Recently while working in a visual studio 2015 workflow for SharePoint online, I received the below error while running the workflow for a particular list item. The workflow went to a suspended mode and the error comes as:

An unhandled exception occurred during the execution of the workflow instance. Exception details: System.UriFormatException: Invalid URL: The format of the URI could not be determined. The error looks like below:

An unhandled exception occurred during the execution of the workflow instance
SharePoint 2013 workflow Error

An unhandled exception occurred during the execution of the workflow instance

In the workflow, we were using HttpSend workflow activity to retrieve the URL of the RootWeb. In HttpSend I was using a variable to return the value form CurrentWebUri value (which returns the site url).

My HttpSend Uri value looks like below:
siteURL+”_api/Site/RootWeb”

The format of the URI could not be determined
SharePoint visual studio 2015 workflow error

Here the value which was coming in siteURL was like below:

https://onlysharepoint2013.sharepoint.com/sites/Bhawana (without “/” at the end)

So my HttpSend Uri was becoming like below:
https://onlysharepoint2013.sharepoint.com/sites/Bhawana_api/Site/RootWeb (missing “/” before _api)

So I changed my HttpSend Uri value to like below

siteURL+"/_api/Site/RootWeb"

Now it generate the URL correctly like below:

https://onlysharepoint2013.sharepoint.com/sites/Bhawana/_api/Site/RootWeb

Read few SharePoint workflow tutorials:

Hope this will be helpful to resolve An unhandled exception occurred during the execution of the workflow instance. The format of the URI could not be determined SharePoint online.

>