安装和配置 SharePoint Server 的工作流Install and configure workflow for SharePoint Server

适用于: 是 2013  是 2016  是 2019  没有 SharePointAPPLIES TO: yes2013 yes2016 yes2019 noSharePoint

本文包含在 SharePoint Server 中配置工作流所需的信息和过程。This article contains the information and procedures required to configure workflow in SharePoint Server.

Important

本文中的步骤适用于 SharePoint Server。The steps in this article apply to SharePoint Server. SharePoint Foundation 2013 中不支持 SharePoint 2013 工作流平台。The SharePoint 2013 Workflow platform is not supported in SharePoint Foundation 2013.

Note

您可以观看视频系列,它将引导您完成安装和配置 SharePoint 2013 工作流平台的过程。You can watch a video series that walks through the process of installing and configuring the SharePoint 2013 Workflow platform. 要查看这些视频,请参阅Video series: Install and configure Workflow in SharePoint Server 2013To view the videos, see Video series: Install and configure Workflow in SharePoint Server 2013

概述Overview

在为 SharePoint Server 生成工作流时,存在一个新选项。A new option exists when you build a workflow for SharePoint Server. This option is called Platform Type.This option is called Platform Type. The figure shows the Platform Type option when you are creating a new workflow by using SharePoint Designer 2013.The figure shows the Platform Type option when you are creating a new workflow by using SharePoint Designer 2013.

图: SharePoint Server 包括三个工作流平台选项。Figure: SharePoint Server includes three workflow platform options.

Three workflow platforms in SharePoint 2013.

首次安装 SharePoint Server 时唯一可用的平台是 SharePoint 2010 工作流平台。The only platform available when you first install SharePoint Server is the SharePoint 2010 Workflow platform. SharePoint 2013 工作流平台和 Project Server 平台需要其他步骤。The SharePoint 2013 Workflow platform and the Project Server platform require additional steps. 下表简要介绍这三个工作流平台。The three workflow platforms are outlined in the following table.

SharePoint Server 中可用的工作流平台类型Workflow Platform types available in SharePoint Server

平台类型Platform Type 平台框架Platform Framework 要求Requirements
SharePoint 2010 WorkflowSharePoint 2010 Workflow
Windows Workflow Foundation 3Windows Workflow Foundation 3
使用 SharePoint Server 自动安装。Installs automatically with SharePoint Server.
SharePoint 2013 WorkflowSharePoint 2013 Workflow
Windows Workflow Foundation 4Windows Workflow Foundation 4
需要 SharePoint Server 和工作流管理器。Requires SharePoint Server and Workflow Manager.
SharePoint 2013 Workflow - Project ServerSharePoint 2013 Workflow - Project Server
Windows Workflow Foundation 4Windows Workflow Foundation 4
需要 SharePoint Server、工作流管理器和 Project Server。Requires SharePoint Server, Workflow Manager, and Project Server.

Note

必须从 SharePoint Server 中单独下载和安装工作流管理器。Workflow Manager must be downloaded and installed separately from SharePoint Server. 安装 SharePoint Server 时不会自动安装。It does not install automatically when you install SharePoint Server.

安装工作流管理器Install Workflow Manager

工作流管理器可以安装在与 SharePoint 相同的服务器上,也可以安装在独立的专用服务器上。Workflow Manager may be installed on the same servers as SharePoint or on separate, dedicated servers. 可以使用 Web PI 工具部署工作流管理器。Workflow Manager can be deployed with the Web PI tool. 有关 Web PI 的详细信息,请参阅使用 Microsoft Web Platform InstallerFor more information on Web PI, see Using the Microsoft Web Platform Installer.

安装和配置 SharePoint ServerInstall and configure SharePoint Server

您必须安装和配置 SharePoint Server。You must install and configure SharePoint Server. 为此,请参阅安装和部署 SharePoint 2013To do so, see Install and deploy SharePoint 2013.

Note

在安装 SharePoint Server 时,将自动安装 SharePoint 2010 工作流平台。The SharePoint 2010 Workflow platform installs automatically when you install SharePoint Server. SharePoint 2013 工作流平台需要工作流管理器,并且必须单独安装,然后配置为与您的 SharePoint Server 服务器场一起使用。The SharePoint 2013 Workflow platform requires Workflow Manager and must be installed separately and then configured to work with your SharePoint Server farm. > 正常运行的 SharePoint 2013 工作流需要设置应用程序管理服务和网站订阅服务。> To function correctly SharePoint 2013 Workflows require to have App Management Service and Site Subscription Service provisioned. 不需要设置通配符证书和 DNS 注册,但这两个实例都需要运行。It is not required to setup a wildcard certificate and DNS registration but both instances need to be running.

将工作流管理器配置为与 SharePoint Server 服务器场一起使用Configure Workflow Manager to work with the SharePoint Server farm

在将工作流管理器配置为与 SharePoint Server 一起工作之前,必须考虑以下两个关键因素。You must consider the following two key factors before configuring Workflow Manager to work with SharePoint Server.

  • 是否将 工作流管理器 安装在作为 SharePoint 服务器场的一部分的服务器上?Is Workflow Manager installed on a server that is part of the SharePoint farm?

  • 工作流管理器和 SharePoint Server 之间的通信使用HTTP还是HTTPSWill communication between Workflow Manager and SharePoint Server use HTTP or HTTPS ?

这些因素可转换为四个方案。These factors translate into four scenarios. 每个方案都将 SharePoint Server 服务器场配置为与工作流管理器服务器场进行通信和工作。Each scenario configures a SharePoint Server farm to communicate and function with the Workflow Manager farm. 请遵循与您的情形相匹配的方案。Follow the scenario that matches your circumstance.

1:工作流管理器安装在作为 SharePoint Server 服务器场一部分的服务器上。1: Workflow Manager is installed on a server that is part of the SharePoint Server farm. 通信通过使用 HTTP 进行。Communication takes place by using HTTP.
2:工作流管理器安装在作为 SharePoint Server 服务器场一部分的服务器上。2: Workflow Manager is installed on a server that is part of the SharePoint Server farm. 通信通过使用 HTTPS 进行。Communication takes place by using HTTPS.
3:工作流管理器安装在不是 SharePoint Server 服务器场一部分的服务器上。3: Workflow Manager is installed on a server that is NOT part of the SharePoint Server farm. 通信通过使用 HTTP 进行。Communication takes place by using HTTP.
4:工作流管理器安装在不是 SharePoint Server 服务器场一部分的服务器上。4: Workflow Manager is installed on a server that is NOT part of the SharePoint Server farm. 通信通过使用 HTTPS 进行。Communication takes place by using HTTPS.

Note

[!注意] 出于安全考虑,我们建议将 HTTPS 用于生产环境。For security reasons, we recommend HTTPS for a production environment.

Tip

[!提示] 有关最小特权配置的信息,请参阅 SharePoint Server 2013 中工作流管理器的最小特权配置.For information about least-privilege configuration, see Least Privilege Configuration for Workflow Manager with SharePoint Server 2013.

在作为 SharePoint 服务器场一部分的服务器上配置工作流管理器以及使用 HTTP 进行通信的服务器To configure Workflow Manager on a server that is part of the SharePoint Server farm and on which communication takes place by using HTTP

  1. 登录到安装了工作流管理器的 SharePoint Server 服务器场中的计算机。Log on to the computer in the SharePoint Server farm where Workflow Manager was installed.

  2. Open the SharePoint Management Shell as an administrator.Open the SharePoint Management Shell as an administrator. 若要实现此目的,请右键单击SharePoint 命令行管理程序并选择 "以管理员身份运行"。This is accomplished by right-clicking the SharePoint Management Shell and choosing Run as administrator.

  3. 运行 Register-SPWorkflowService cmdlet。Run the Register-SPWorkflowService cmdlet.

    示例Example:

Register-SPWorkflowService -SPSite "http://myserver/mysitecollection" -WorkflowHostUri "http://workflow.example.com:12291" -AllowOAuthHttp
  1. 登录到 SharePoint Server 服务器场中的每台服务器。Log on to each server in the SharePoint Server farm.

    SharePoint Server 场中的每台服务器都必须安装工作流管理器客户端。Each server in the SharePoint Server farm must have the Workflow Manager Client installed.

    Note

    [!注意] 当您在服务器上安装工作流管理器时,系统会自动在该服务器上安装工作流管理器客户端。但您仍需要在任何其他服务器上安装工作流管理器客户端。例如,如果您拥有一个包含 5 个服务器的服务器场并且您在其中一个服务器上安装了工作流管理器,则您仍需要在其他四个服务器上安装工作流管理器客户端。When you install Workflow Manager on a server it automatically installs the Workflow Manager Client on that server. You will still need to install the Workflow Manager Client on any additional servers. For example, if you have a farm that contains five servers and you install Workflow Manager on one of those servers you will still need to install the Workflow Manager Client on the four additional servers.

  2. 在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端。Install the Workflow Manager Client on each server in the SharePoint farm.

    您可以在此处下载和安装工作流管理器客户端:https://go.microsoft.com/fwlink/p/?LinkID=268376Download and install the Workflow Manager Client here: https://go.microsoft.com/fwlink/p/?LinkID=268376

在作为 SharePoint Server 服务器场一部分的服务器上配置工作流管理器以及使用 HTTPS 进行通信To configure Workflow Manager on a server that is part of the SharePoint Server farm and on which communication takes place by using HTTPS

  1. 确定您是否需要在 SharePoint 中安装 工作流管理器 证书。Determine if you need to install Workflow Manager certificates in SharePoint.

    在某些情形下,您必须获取并安装 工作流管理器 证书。如果您的安装需要您获取并安装这些证书,则在继续之前,必须完成此步骤。若要了解您是否需要安装证书并获取相关说明,请参阅 在 SharePoint Server 2013 中安装工作流管理器证书Under some circumstances, you have to obtain and install Workflow Manager certificates. If your installation requires that you obtain and install these certificates, you must complete that step before continuing. To learn whether you need to install certificates, and for instructions, see Install Workflow Manager certificates in SharePoint Server.

  2. 登录到安装了工作流管理器的 SharePoint 服务器场中的计算机。Log into the computer in the SharePoint Server farm where Workflow Manager was installed.

  3. Open the SharePoint Management Shell as an administrator.Open the SharePoint Management Shell as an administrator. 若要实现此目的,请右键单击SharePoint 命令行管理程序并选择 "以管理员身份运行"。This is accomplished by right-clicking the SharePoint Management Shell and choosing Run as administrator.

  4. 运行 Register-SPWorkflowService cmdlet。Run the Register-SPWorkflowService cmdlet.

    示例Example:

Register-SPWorkflowService -SPSite "https://myserver/mysitecollection" -WorkflowHostUri "https://workflow.example.com:12290"
  1. 登录到 SharePoint Server 服务器场中的每台服务器。Log on to each server in the SharePoint Server farm.

    SharePoint Server 场中的每台服务器都必须安装工作流管理器客户端。Each server in the SharePoint Server farm must have the Workflow Manager Client installed.

    Note

    [!注意] 当您在服务器上安装工作流管理器时,系统会自动在该服务器上安装工作流管理器客户端。但您仍需要在任何其他服务器上安装工作流管理器客户端。例如,如果您拥有一个包含 5 个服务器的服务器场并且您在其中一个服务器上安装了工作流管理器,则您仍需要在其他四个服务器上安装工作流管理器客户端。When you install Workflow Manager on a server it automatically installs the Workflow Manager Client on that server. You will still have to install the Workflow Manager Client on any additional servers. For example, if you have a farm that contains five servers and you install Workflow Manager on one of those servers you will still need to install the Workflow Manager Client on the four additional servers.

  2. 在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端。Install the Workflow Manager Client on each server in the SharePoint farm.

    您可以在此处下载和安装工作流管理器客户端:https://go.microsoft.com/fwlink/p/?LinkID=268376Download and install the Workflow Manager Client here: https://go.microsoft.com/fwlink/p/?LinkID=268376

在不属于 SharePoint Server 服务器场且使用 HTTP 进行通信的服务器上配置工作流管理器的具体过程To configure Workflow Manager on a server that is NOT part of the SharePoint Server farm and on which communication takes place by using HTTP

  1. 登录到 SharePoint Server 服务器场中的每台服务器。Log on to each server in the SharePoint Server farm.

  2. 在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端。Install the Workflow Manager Client on each server in the SharePoint farm.

    必须先在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端,然后才能运行配对的工作流 cmdlet。Before you can run the workflow pairing cmdlet, you must install Workflow Manager Client on each of the servers in the SharePoint farm.

    您可以在此处下载和安装工作流管理器客户端:https://go.microsoft.com/fwlink/p/?LinkID=268376Download and install the Workflow Manager Client here: https://go.microsoft.com/fwlink/p/?LinkID=268376

  3. Open the SharePoint Management Shell as an administrator. This is accomplished by right-clicking the SharePoint 2013 Management Shell command and choosing Run as administrator.Open the SharePoint Management Shell as an administrator. This is accomplished by right-clicking the SharePoint 2013 Management Shell command and choosing Run as administrator.

  4. 运行 Register-SPWorkflowService cmdlet。此 cmdlet 只应运行一次,并且可以从 SharePoint 服务器场中的任何服务器运行。Run the Register-SPWorkflowService cmdlet. The cmdlet should be run only once and can be run from any of the servers in the SharePoint farm.

    示例Example:

Register-SPWorkflowService -SPSite "http://myserver/mysitecollection" -WorkflowHostUri "http://workflow.example.com:12291" -AllowOAuthHttp

Important

[!重要说明] 必须先在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端,然后才能运行配对的 cmdlet。You must install the Workflow Manager Client on each server in the SharePoint farm before you run the pairing cmdlet.

在不属于 SharePoint Server 服务器场且使用 HTTPS 进行通信的服务器上配置工作流管理器的具体过程To configure Workflow Manager on a server that is NOT part of the SharePoint Server farm and on which communication takes place by using HTTPS

  1. 确定您是否需要在 SharePoint 2013 中安装 工作流管理器 证书。Determine whether you need to install Workflow Manager certificates in SharePoint 2013.

    在某些情形下,您必须获取并安装 工作流管理器 证书。如果您的安装需要您获取并安装这些证书,则在继续之前,必须完成此步骤。若要了解您是否需要安装证书并获取相关说明,请参阅 在 SharePoint Server 2013 中安装工作流管理器证书Under some circumstances, you have to obtain and install Workflow Manager certificates. If your installation requires that you obtain and install these certificates, you must complete that step before continuing. To learn whether you need to install certificates, and for instructions, see Install Workflow Manager certificates in SharePoint Server.

  2. 登录到 SharePoint Server 服务器场中的每台服务器。Log on to each server in the SharePoint Server farm.

  3. 在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端。Install the Workflow Manager Client on each server in the SharePoint farm.

    必须先在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端,然后才能运行配对的工作流 cmdlet。Before you can run the workflow pairing cmdlet, you must install Workflow Manager Client on each of the servers in the SharePoint farm.

    您可以在此处下载和安装工作流管理器客户端:https://go.microsoft.com/fwlink/p/?LinkID=268376Download and install the Workflow Manager Client here: https://go.microsoft.com/fwlink/p/?LinkID=268376

  4. Open the SharePoint Management Shell as an administrator.Open the SharePoint Management Shell as an administrator. 若要实现此目的,请右键单击SharePoint 命令行管理程序命令,然后选择 "以管理员身份运行"。This is accomplished by right-clicking the SharePoint Management Shell command and choosing Run as administrator.

  5. 运行 Register-SPWorkflowService cmdlet。Run the Register-SPWorkflowService cmdlet.

    示例Example:

Register-SPWorkflowService -SPSite "https://myserver/mysitecollection" -WorkflowHostUri "https://workflow.example.com:12290"

Important

必须先在 SharePoint 服务器场中的每台服务器上安装工作流管理器客户端,然后才能运行配对的 cmdlet。You must install the Workflow Manager Client on each server in the SharePoint farm before you run the pairing cmdlet.

验证安装Validate the installation

使用这些步骤验证您已成功安装和配置所需组件。Use these steps to validate that you have successfully installed and configured the required components.

验证安装的具体步骤To validate the installation

  1. 将某个用户添加到 SharePoint 网站,并授予该用户"网站设计者"权限。Add a user to your SharePoint site, and grant the user Site Designer permissions.

  2. 安装 SharePoint Designer 2013 并创建基于 SharePoint 2013 Workflow 平台的工作流。有关详细信息,请参阅通过使用 SharePoint Designer 2013 和 SharePoint 2013 Workflow 平台创建工作流Install SharePoint Designer 2013 and create a workflow based on the SharePoint 2013 Workflow platform. For more information, see Creating a workflow by using SharePoint Designer 2013 and the SharePoint 2013 Workflow platform.

  3. 从 SharePoint 用户界面运行此工作流。Run this workflow from the SharePoint user interface.

问题排查Troubleshooting

出于安全考虑,"安装"帐户不可用于创建基于 SharePoint 2013 Workflow 平台的工作流。如果您尝试通过使用 SharePoint Designer 2013 创建基于 SharePoint 2013 Workflow 平台的工作流,则会接收到一条警告信息,指出工作流操作列表不存在,未创建工作流。For security reasons, the Setup account cannot be used to create a workflow based on the SharePoint 2013 Workflow platform. If you try to create a workflow based on the SharePoint 2013 Workflow platform by using SharePoint Designer 2013, you receive a warning that the list of workflow actions do not exist, and the workflow is not created.

必须将部署和运行工作流的用户添加到 User Profile Service。检查管理中心中的 User Profile Service 应用程序页,以确认要用于验证工作流安装的用户位于 User Profile Service 中。The user who deploys and runs a workflow must be added to the User Profile service. Check the User Profile service application page in Central Administration to confirm that the user you are using to validate workflow installation is in the User Profile service.

您可以通过使用 IIS 管理器来确定 SharePoint Server 和工作流管理器在 HTTP 和 HTTPS 中使用的端口,如图所示。You can determine which ports SharePoint Server and Workflow Manager are using for both HTTP and HTTPS by using IIS Manager as shown in the figure.

图:使用 IIS 管理器查看由工作流管理器使用的端口Figure: Use IIS Manager to view the ports used by Workflow Manager

View ports in IIS Manager.

工作流管理器 通过使用 TCP/IP 或命名管道进行通信。确保在承载 工作流管理器 数据库的 SQL Server 实例上启用相应的通信协议。Workflow Manager communicates by using TCP/IP or Named Pipes. Make sure that the appropriate communication protocol is enabled on the SQL Server instance that hosts the Workflow Manager databases.

SQL Browser Service 必须在承载 工作流管理器 数据库的 SQL Server 实例上运行。The SQL Browser Service must be running on the SQL Server instance that hosts the Workflow Manager databases.

系统帐户不可用于开发工作流。The System Account cannot be used to develop a workflow.

若要对 SharePoint Server 进行故障排除,请参阅Sharepoint Server 疑难解答To troubleshoot SharePoint Server, see Troubleshooting SharePoint Server.