Archive for the ‘WorkFlows’ Category

WorkFlow Manager Exception: Register-SPWorkflowService Failed to query the OAuth S2s metadata error

December 8, 2015 Leave a comment

After completing the installation of workflow manager component on the system, we need to configure it so that it works with SharePoint Farm 2013, to complete this step we should run the following Commands on SharePoint 2013 Management Shell

Register-SPWorkflowService -SPSite ‘https://myhost/mysite’ -WorkflowHostUri ‘http://workflowhost:12991’

Workflow Manager URL has to be fully qualified server name with appropriate port no

But  it throws the following error



After investigating and reviewing SharePoint Log Files, I found the following error

Microsoft.Workflow.Client.InvalidRequestException: Failed to query the OAuth S2S metadata endpoint at URI ‘http://×××××××××/_layouts/15/metadata/json/1’. Error details: ‘The metadata endpoint responded with an error. HTTP status code: Forbidden.’. HTTP headers received from the server – ActivityId: 510ac2df-d86a-443d-a45a-f74ce471a45d. NodeId: MU-SPW-D01. Scope: /SharePoint. Client ActivityId : b6023d4e-806b-49b6-ae9f-5da187ab42d8. —> System.Net.WebException: The remote server returned an error: (400) Bad Request.     at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)     at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)

Actually, this issue may appear for more than reason, but do the following actions to solve your issue

  • maybe it trying to connect to SharePoint URL (http://xxxx/_layouts/15/metadata/json/1) and it is not accessible from workflow manager server , in this case you , you should add the SharePoint url to the Workflow manager server host file
  • run the below command before running the Register-SPWorkflowService  command$config = (Get-SPSecurityTokenServiceConfig)
    $config.AllowOAuthOverHttp = $true
    $config.AllowMetaDataOverHttp = $true

WorkFlow Manager 1.0 Configuration Exception

December 8, 2015 1 comment

I have been working on SharePoint 2013 project, and one of the requirements is installing and configuring workflow manager, according to our topology design, there is a separate server for workflow manager. The installing started smoothly by running Microsoft Web Platform Installer, workflow manager 1.0 component has been installed successfully, and then I tried to install Cumulative Update for Service Bus 1.0 by using Microsoft Web Platform Installer (to install Cumulative Update 2 for Workflow Manager 1.0 we must install Cumulative Update for Service Bus 1.0), when I started to search about the component using Microsoft Web Platform Installer, it appears Cumulative Update for Service Bus 1.0 already installed ! any way , Cumulative Update 2 for Workflow Manager 1.0 has installed successfully by using Microsoft Web Platform Installer Also . Finally, I started to configure workflow manager farm, create workflow instance databases and configure service bus using workflow manager configuration manager wizard , at first steps everything is fine until “Get Service Bus Client Configuration ” step of the configuration , it thrown  the following exception

The remote server returned an error: (400) Bad Request. The api-version in the query string is not supported. Either remove it from the Uri or use one of ‘2012-03’


That issue Looks like a service bus version issue. So you have to ensure that Cumulative Update for Service Bus 1.0 is already installed on this server, try using Microsoft Web Platform Installer or you can download that component directly from Microsoft website then install it . i solved my issue by this way


workflows in Visual Studio 2012

October 4, 2012 Leave a comment

Create a workflow using Visual Studio 2012

Visual Studio 2012 has SharePoint 2013 Preview workflow project types built in. To create a SharePoint workflow project in Visual Studio, follow these steps.

To create a workflow using Visual Studio

  1. Open Visual Studio 2012 and create a new project. In the New Project dialog box, choose TemplatesVisual C#Office SharePointSharePoint Solutions, andSharePoint 2013 Project, as shown in Figure 2.

    Figure 1. New Project dialog box

  2. With the project created, choose Add New Item on the Project menu, and then choose Workflow under the Office SharePoint item, as shown in Figure 3.

    Figure 2. Add New Item dialog box

  3. After the workflow project is created, you are presented with a designer surface on which to create your workflow. The workflow development environment includes a custom toolbox with a large palette of workflow authoring elements.

    Figure 3. Visual Studio workflow authoring toolbox

Reusable and Globally Reusable Workflows in SharePoint 2010


As we know, we’ve had workflows in SharePoint designer 2007, but we cannot move created workflow into another site or list somewhere else.

Now, there is a feature called “reusable workflows” in SharePoint Designer 2010 which gives us the capabilities of applying the created workflow on another list and move the workflow to other lists.

But we have to Differentiate between the terms “Reusable Workflows” and “Globally Reusable Workflows”

When you create a Reusable workflow in SharePoint Designer 2010, it’s by default reusable within the site it has been created in, which means that it can be attached to any list within this site. But what if you want your workflow to be reusable in the whole site collection? Well, this is the definition of “Globally Reusable Workflows”. You can easily convert your workflows to be available anywhere in your site collection by opening your workflow and clicking on “Convert to Globally Reusable” from the ribbon as shown below.

Also it’s worth mentioning that only the workflows created at the root level of the site collection can be converted to be Globally Reusable but other ones created in sub sites cannot. Try to create a workflow in a sub site, open it and note that the Conversion button is dimmed.

Another important question is what if I want to take my workflow and give it to somebody else in a different site collection? There’s another button in the ribbon called “Save as Template”, this takes the workflow, put it in a wsp file and save it to the ‘Site Assets” library. You can export this file and deploy it to other site collection and what’s really cool is that you can import this wsp into Visual Studio and extend it over there.


Categories: WorkFlows