Create Document

Use this step to create a new document on the Sharepoint site.

Last published at: September 10th, 2025

spCreateDocument Step

Description:

The Create Document workflow step uploads a source file to a specified SharePoint site and saves the resulting operation information in a workflow variable or global variable.

The step supports:

  • Uploading a workflow file to SharePoint
  • Connecting to a specified SharePoint site using its base URL
  • OAuth provider selection for SharePoint authentication
  • Configurable source and destination file paths
  • Storage of the operation result in a variable or global variable

This step can be used for:

  • Publishing workflow-generated documents to SharePoint
  • Archiving documents in SharePoint
  • Moving files from workflow-managed storage into SharePoint
  • Saving completed reports or forms to a SharePoint document library
  • Creating document repositories as part of business processes
  • Integrating FlowWright workflows with SharePoint-based document management
  • Automatically distributing workflow output files

 

Inputs

  • BaseURL – The base URL for the SharePoint site.
  • selOAuthProvider - Select the OAuth provider used to authenticate with the SharePoint site. 
  • sourceFilePath – The path of the source file to be uploaded.
  • destinationFilePath – The path where the file should be saved in the SharePoint site.
  • resultJson – Variable or Global variable used to store the result of the document creation operation.
 

 

Returns

  • True – Step executed successfully
  • False – Step failed to execute 
 

 

Usage:

The Create Document step is typically placed after a document has been created, generated, received, or otherwise made available within a workflow.

The workflow can dynamically determine the source file and SharePoint destination using variables, form values, previous workflow outputs, or other workflow data.

The uploaded document can then be used by later workflow steps or by users working with the SharePoint repository.

Typical uses include:

  • Uploading generated reports to SharePoint
  • Archiving completed workflow documents
  • Publishing approved documents
  • Storing documents in project-specific SharePoint folders
  • Creating a SharePoint copy of a workflow attachment
  • Making workflow-generated documents available to business users
  • Integrating document processing workflows with SharePoint repositories

 

Typical Workflow Suggestions

Generate and Publish a Report

Use a document-generation step to create a report, followed by Create Document to publish the resulting file to a SharePoint document library.

Typical flow:

Start → Generate Document → Create Document → End

 

Approval and SharePoint Archiving

After a document completes the approval process, use Create Document to archive it in SharePoint.

Typical flow:

Start → Create/Receive Document → Approval → Create Document → End

 

Store Completed Forms

Use the step after a workflow form or document has been completed to place the resulting file in a SharePoint folder.

Typical flow:

Start → Form Processing → Create Document → End

 

Project Document Management

Build the destination path dynamically from workflow information such as project, department, customer, or process data.

Typical flow:

Start → Collect Project Data → Generate Document → Create Document → Notification → End

 

Automated Document Distribution

Upload the completed document to SharePoint, then notify users or downstream processes that it is available.

Typical flow:

Start → Create Document → Send Notification → End

 

Example:

Let’s build and execute the “spCreateDocumentDef” example.          

  • Create a new definition called “spCreateDocumentDef" and open the definition in designer mode. 
  • Drag a “spCreateDocument” step to the canvas. 
  • Connect the dots between the “Start” and “spCreateDocument” steps, as shown above. 
  • Select the line between the steps to configure the “Connection Properties”. The default property values are “None, Error, Evaluate, and Timeout”. Depending on the step’s purpose, additional values are available for configuration. 
  • Click the “spCreateDocument” step to configure its “Settings” properties. Provide a name for the step. Provide the base URL for the SharePoint site. Select the SharePoint provider from the dropdown list. Provide the source file name and the path on the application server where the file will be uploaded. Provide the file path to save the document on the SharePoint site. Provide a variable or a global to store the result. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new process instance, and execute it. When the workflow reaches the Create Document step, FlowWright uses the configured SharePoint site and OAuth provider to upload the specified source file to the configured destination path. The result of the operation is stored in the configured variable or global variable.

 

Tips:

  • Verify that the BaseURL points to the intended SharePoint site.
  • Use the appropriate OAuth provider for the SharePoint connection.
  • Make sure the sourceFilePath points to the file the workflow intends to upload.
  • Verify that the destinationFilePath points to the intended SharePoint location.
  • Use variables or global variables to dynamically set the source and destination paths when documents are generated during workflow execution.
  • Store the operation result in resultJson for subsequent workflow processing that needs access to it.
  • Test the SharePoint destination and authentication configuration before deploying the workflow.

 

Notes:

  • A SharePoint BaseURL is required.
  • An OAuth provider must be selected.
  • A source file path and SharePoint destination file path are required.
  • The step has two incoming and two outgoing connections according to its process-step definition.
  • The XML definition identifies the step as Create Document and places it in the SharePoint category.
  • The step is implemented by FlowWright.Workflow.dll in the FlowWright.Workflow.SpCreateDocument namespace.
  • The available execution returns are True and False.

 

Definition Sample:

You may download the sample definition and later import it into your FlowWright Process Definition (XML file) page.

Note: Verify and complete any missing configuration after importing the sample, including:

  • SharePoint BaseURL
  • OAuth provider selection
  • Source file path
  • Destination file path
  • Result variable or global variable
  • Environment-specific SharePoint settings

After verifying the configuration, save the Process Definition before execution.

Click here to download the sample file.