Introduction

Lightning Flow provides two workflow tools that help you easily automate output generation. The Process Builder and the Flow Builder. These tools provide user-friendly graphical representations of your flow as you build it.

Process Builder

Use Process Builder when you need to start a behind-the-scenes business process automatically. The Process Builder creates an automated output generation process based on records.

Processes can start when:

  • A record is created
  • A record is updated
  • A platform event occurs

The process consists of:

  • Criteria that determine when to execute
  • Immediate actions to execute when criteria are met

Any change that causes a record to match the criteria can automatically trigger output generation.

See Create a Process for details on how to create a process.

Docomotion supports creating, in the Process Builder, a process with multiple steps. See the 2-step example.

Flow Builder

Use Flow Builder to:

  • Automate a guided visual experience.
  • Add more functionality for a behind-the-scenes process than is available in Process Builder. Use Flow Builder to build more complex functionalities. Then call the resulting flow from the process.
  • Start a behind-the-scenes business process when a user clicks something, like a button.
See Build a Flow for details on how to build flows.

Note for System Administrators:

Docomotion Licensing

Each user who might trigger a Process Builder or Flow Builder for generating output using Docomotion needs a Docomotion license. In organizations that purchased a Price Per Action (PPA) license, documents can be generated by users without a Docomotion license. However, in order to generate output, these users need to be assigned Docomotion Generator permission set.
Note that no error message appears if a document is not generated due to lack of a license.
For more information contact the Docomotion Support team.

Using the Process Builder to Create an Output Generation Process

To configure the process for output generation:

1. Within the process builder, create and define the process according to your requirements (see Create a Process).

2. In the flow diagram click IMMEDIATE ACTIONS > +Add Action.

3. From the Action Type dropdown list select Apex.

4. In the Action Name text box enter a name for the action.

5. From the Apex Class dropdown list select one of the following:

  • Generate Document: the output is generated to the specified channel in the selected format.
  • Generate Link: A link to the output is sent to the Signer.
  • Mail Body: The output is generated as an email body and sent to the specified recipient
  • Mail Attachments: The output is generated in the selected format, attached to an email of the specified template and sent to the recipient.

6. Enter the required values in the Set Apex Variables Type and Value columns.

The Set Apex Variables options change according to the Apex class you selected. See Input Values (Flow Builder)/Apex Variables (Process Builder)

Using the Flow Builder to Create an Output Generation Flow

To configure the Flow for output generation:

1. Within the Flow Builder, create a new flow (see Build a Flow).

2. Select the action type: Apex Action.

3. Select Apex action:

  • Generate Document: the output is generated to the specified channel in the selected format.
  • Generate Link: A link to the output is sent to the Signer.
  • Mail Body: The output is generated as an email body and sent to the specified recipient
  • Mail Attachments: The output is generated in the selected format, attached to an email of the specified template and sent to the recipient.

4. Add a Label.

5. Set the required Input Values. (Store Output Values is not supported).
You can enter values or search for resources.

The Input Values options change according to the Apex class you selected. See Input Values (Flow Builder)/Apex Variables (Process Builder)

Input Values (Flow Builder)/Apex Variables (Process Builder)

Apex Variable Description Type Generate Document Generate Link Email Body Email with Attachments
Format PDF, HTML, DOCX The format of the generated output string
Form # Number of the Form to generate from. Should be the same object as the Generate on variable. number
Generate on Salesforce ID or The reference to the object that invokes the process (or its lookups) Salesforce ID or
Reference to record ID (*)
Channel – Document, Attachment, Chatter The output channel for the generated output: Document, Attachment, Chatter string  
Signer The recipient of the email Salesforce Contact ID
or
Reference to Contact record ID
 
Use Active Version Output can be generated also if the Form is in Active (not Published) state boolean    
Email Recipient ID ID of the person to receive the output as an email Salesforce Contact ID
or
Reference to Contact record ID
Insert Template ID ID of the Salesforce email template to which the output is added as an attachment.

Salesforce Email Template ID

File name/Subject (optional) To add click Add Row and select the variable.

string