Prerequisites
-
Install the Documill document generation package from AppExchange.
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000009whyxEAA
Detailed instructions can be found here.
-
Install the Agentforce connector package from AppExchange.
https://appexchange.salesforce.com/appxListingDetail?listingId=efb6d55a-fe5b-48cf-b256-e168d8300b58 -
Set-up your Salesforce OAuth 2.0 client credentials flow.
No-code API setup for Salesforce Flows
This step is required to properly communicate with external apps based on Salesforces' security requirements.
Permissions
To generate documents with Documill, you will need to assign the appropriate Documill permission set to the user who has been declared in step 3 of the pre-requisites.
https://support.documill.com/dynamo/user-permission-sets
Documill uses Salesforce to handle all permissions. Any user generating the document, will need to have at least read permissions on the template file and any objects and records used within the document.
Setting up the Agent
If you do not yet have an Agent, now is the time to create one. From the Salesforce setup, open Agentforce Agents.
From here, you can either modify an existing agent, or create a brand new one using the “+New Agent” button on the top right.
If creating a new Agent, we suggest using the “Agentforce Employee Agent” as the starting point.
From within the Agentforce Builder, create a new Subagent. Subagents will be able to trigger Documill later on.
Next, configure your Agent’s instructions based on your needs.
After the Subagent has been given proper instructions, include the relevant Actions. The package comes with 2 pre-defined actions, one for generating single Quotes from Opportunity records, and the second for mass document generation. The Query Records action is also needed.
Click “Finish” and now your new Subagent will appear on the list.
At this stage, its advised to test the agent and see if the correct Subagent is triggered.
In this case, the Documill subagent we just created triggered as expected.
Configure the Flow
The two actions included in the Agentforce connector package are designed to trigger a Salesforce flow which in turn will communicate with Documill via API to generate the desired document. As this flows require customer specific information, they need some additional configuration before use.
From the Salesforce Setup, navigate to “Flows”
Here, you will find 3 flows which were included in the Agentforce connector package.
The exact structure of the Flow will depend on your needs. Bellow you can find two simple examples:
Task API Use Case
Batch API Use Case
All Flows will require a Documill template to run. Please reffer to the following article and learn how to create an API template Create or change an API template or use this sample Opportunity Quote template: Quote Sample.dap
Testing the Agent
Now that all the components have been created, it is time to test the agent. Ensure that both the Agent and Flows are activated.
From the desired record, open the agent and give them a meaningful prompt that your users may use.
The Agent will then confirm that the process has been completed.
From here, the Agent can be further customized or tuned based on your own needs and prefferences. As this integration is quite modular, the possible application are endless. Try adding prompt templates to the flow for enhanced content creation!