SharePoint - Start workflow

Declaration

<AMSHAREPOINT ACTIVITY="start_workflow" SESSION="text" WORKFLOWNAME="text" LIST="text" ITEMID="text" RESULTVARIABLE="text" />

Related Topics    

Description

Starts a SharePoint workflow.

NOTE: You must have at least the Edit Items permission to start a workflow. Some workflows might require that you also have the Manage Lists permission or another specific permission to start a workflow on a document or item.

Practical Usage

Used to manually start a workflow on a document or item directly from the list or library where it is saved.

Parameters

Connection

Property

Type

Required

Default

Markup

Description

Connection

---

---

---

---

Indicates where this activity's SharePoint credentials should originate from. This is a visual parameter used only during design-time, thus, contains no properties or markups. The available options are:

  • Host - Specifies that a custom set of credentials will be entered for this activity. This option is normally selected if only a single SharePoint activity is required to complete the operation.

  • Session - Specifies that credentials should derive from a session created in a previous Create session step. This allows several activities to be linked to a specific session, eliminating redundancy. Multiple sessions can exist within a single task, allowing several SharePoint operations to be automated simultaneously.

Session

Text

Yes if Connection set to Session

SharePoint

Session1

SESSION="mySession1"

The name of the session to associate with this activity. This parameter is active only if the Connection parameter above is set to Session. If the Connection parameter is set to Host, this parameter is ignored and the remainder of the parameters specified below become active.

Version

Text (options)

Yes if Connection set to Host

SharePoint 2010

  1. VERSION="sharepointonline"

  2. VERSION="sharepoint2010"

  3. VERSION="sharepoint2007"

The SharePoint version to associate with this activity. The available options are:

  • SharePoint Online - A cloud-based service, hosted by Microsoft as an alternative to installing and deploying SharePoint Server on premises.
  • SharePoint 2010 and newer (default) - SharePoint version 2010 or newer - includes SharePoint Foundation 2010/2013 and SharePoint Server 2010/2013.
  • SharePoint 2007 and older - SharePoint version 2007 - includes Windows SharePoint Services (WSS) v3 edition and Microsoft Office SharePoint Server 2007 (MOSS 2007) edition.

NOTE:  Some SharePoint activities are only supported in SharePoint 2010 or newer.

Site

Text

Yes if Connection set to Host

(Empty)

SITE="http://myServer/tech"

The SharePoint site to access. A SharePoint site is a collection of pages, site templates, lists, and libraries configured for the purpose of achieving an express goal.

Authentication type

Text (options)

No

Default

  1. AUTHTYPE="form"

  2. AUTHTYPE="anonymous"

  3. AUTHTYPE="basic"

  4. AUTHTYPE="digest"

  5. AUTHTYPE="ntlm"

The method of authentication to utilize. Authentication types vary depending on the SharePoint version. Different parameters become active depending on which authentication method is selected. Below lists available authentication methods and their compatibility.

  • Default (default) - Compatible with SharePoint 2010 or newer.

  • Basic - Compatible with all SharePoint versions.

  • Form - Compatible with SharePoint 2010 or newer.

  • Anonymous - Compatible with SharePoint 2010 or newer.

  • Digest - Compatible with SharePoint 2007 or older.

  • Proprietary - Compatible with SharePoint 2007 or older.

  • None - Compatible with SharePoint 2007 or older.

  • NTLM - Compatible with SharePoint 2007 or older.

Username

Text

Yes

(Empty)

USERNAME="theUserName"

A valid SharePoint username. This parameter may or may not be active depending on which option is selected under the Authentication type parameter.

Password

Text

Yes

(Empty)

PASSWORD="encryptedText"

A valid SharePoint password to authenticate the username entered above. This parameter may or may not be active depending on which option is selected under the Authentication type parameter.

Domain

Text

Yes

(Empty)

DOMAIN="myServer"

The domain that the user belongs to. This parameter may or may not be active depending on which option is selected under the Authentication type parameter.

Certificate

Text

No

(Empty)

CERTIFICATE="C:\Temp\file.cer"

The (DER encoded) certificate to use for SharePoint authentication. This parameter may or may not be active depending on which option is selected under the Authentication type parameter.

Ignore invalid certificate

Yes/No

No

No

IGNOREINVALIDCERTIFICATE="yes"

If set to YES, specifies that invalid server certificates that are detected will be automatically ignored. Set to NO by default.

Timeout (seconds)

Number

No

600

TIMEOUT="500"

The total number of seconds allowed to connect to the SharePoint server before a timeout error is generated. The default value is 600 seconds.

Proxy type

Text (options)

No

Default

  1. PROXYTYPE="none"

  2. PROXYTYPE="http"

The type of proxy required for SharePoint connections that pass through a proxy server. The available options are:

  • System default (default) - Points to the default proxy used by the system.

  • None - No proxy authentication required.

  • HTTP - Proxy type is HTTP.

Use authentication

---

---

---

---

If enabled, specifies that proxy authentication is required, enabling authentication-based parameters (disabled by default). This is a design-time parameter, therefore, contains no properties or markups. It is active only if the Proxy type parameter is set to HTTP.

Proxy server

Text

No

(Empty)

PROXYSERVER="proxy.host.com"

The host name (server.domain.com) or IP address (xxx.xxx.xxx.xxx) of the proxy server. This parameter is available only if the Proxy type parameter is set to HTTP.

Proxy username

Text

No

(Empty)

PROXYUSERNAME=username

The proxy username to authenticate with. This parameter is available only if the Use Authentication parameter is enabled.

Proxy password

Text

No

(Empty)

PROXYPASSWORD="encrypted"

The proxy password to authenticate with. This parameter is available only if the Use Authentication parameter is enabled.

Proxy port

Number

No

808

PROXYPORT="8080"

The port that should be used to connect to the proxy server. This parameter is available only if the Proxy type parameter is set to HTTP. The default value is 808.

Workflow

Property

Type

Required

Default

Markup

Description

Workflow type

Text (options)

Yes

(Empty)

SCOPE="list"

The type of workflow to start. The available options are:

  • Site (default) - Start a SharePoint Foundation website workflow.
  • List - Start a workflow associated to a list on a SharePoint Foundation website.

Workflow name

Text

Yes

(Empty)

WORKFLOWNAME="myWorkflow"

The name of the workflow to start.  

List title

Text

Yes if Workflow type is set to List

(Empty)

LIST="myList"

The title of the list in which the workflow belongs. This parameter is available only if the Workflow type parameter is set to List.

Item ID

Text

Yes if Workflow type is set to List

(Empty)

ITEMID="myID"

The item ID of the workflow. This parameter is available only if the Workflow type parameter is set to List.

Populate variable with workflow instance ID

Text

Yes

(Empty)

RESULTVARIABLE="wfID"

The name of an existing variable to populate with the instance ID of the workflow that started.

 

Description

Error Causes

On Error

Example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description

This simple task demonstrates AutoMate's ability to start a SharePoint workflow.

NOTE: This sample is for AML viewing purposes only. In order for the task to work, it must be modified to fit your SharePoint credentials.

 

<AMSHAREPOINT ACTIVITY="create_session" SITE="https://netauto.sharepoint.com/sites/test" VERSION="sharepointonline" USERNAME="spiderman@networkautomation.com" PASSWORD="AM4eOqkKV8d1RTijYVt1zfj0OeUeP9k36gAaME" SESSION="SharePointSession1" />

<AMSHAREPOINT ACTIVITY="start_workflow" SESSION="SharePointSession1" WORKFLOWNAME="%siteWorkflowName%" RESULTVARIABLE="siteWorkflowInstanceID" />

<AMSHAREPOINT ACTIVITY="end_session" SESSION="SharePointSession1" />