-
From the Salesforce Setup, go to Process Automation -> Flows.
-
Click New Flow
-
Select the needed flow type. In this example, Triggered Automations - Record Triggered Flow will be selected.
-
Configure the Flow Start per your needs.
In this example, we will trigger the flow when an Opportunity is set to Closed Won.
Note: Enable “Add Asynchronous Path” when working with Triggered Flows.
-
On the left-hand side of the screen, add a new Resource
-
Configure new resource as so:
Resource Type: Variable
API Name: PostTaskBody
Data Type: Apex-Defined
Apex Class: ExternalService__TaskAPIExternalService_PostTaskRequest
-
Click Done.
-
Add an Assignment Action in the Run Asynchronously branch.
-
Name the assignment AssignBody
-
Assign the following variables:
|
Variable |
Value |
|---|---|
|
{!PostTaskBody.integration.z0type} |
Salesforce |
|
{!PostTaskBody.integration.serverURL} |
{!$Api.Partner_Server_URL_570} |
|
{!PostTaskBody.params.id} |
{!$Record.Id} |
|
{!PostTaskBody.params.apiAction} |
<apiAction> |
|
{!PostTaskBody.template} |
<templateID> |
apiAction: This can either be ‘share’ or ‘reminder’. Reminder is only used when automating an e-Signature reminder workflow, ‘share’ should be used in all other cases.
templateID: Content Document ID of the Documill template to be used.
-
Add the Post Task action after the Assignment.
-
Give it a name and set the PostTaskBody as it’s body.
Body: {!PostTaskBody}
Leave the rest as it. -
Next, Save the flow first and then click Debug.
-
Set the Path, Test record and click Run.
-
If the setup was done correctly, the flow should finish with no errors.
-
The flow is now ready to be activated. Customize as needed before doing so.