Before you use this tool

The user the connection acts as needs a CloudFiles Document Generation license. See Who the Agent Acts As. Your CloudFiles account must be connected to Salesforce, because CloudFiles reads the record's data through that connection. To save the document in a folder, the folder's library must be connected for the user the connection acts as. To send it for signing as soon as it is generated, DocuSign must be connected to your CloudFiles account.

Inputs

Template and record

InputRequiredDescription
templateIdYesThe template's ID, from list-templates.
recordIdYesThe ID of the Salesforce record to fill the template from, 15 or 18 characters.
variablesNoValues for the template's variables, as a list of entries named as list-templates names them. A variable that takes a list gets values, a list of strings. Any other variable gets value, a string. Up to 100 entries.
outputFormatNonative keeps the template's own file type, such as DOCX. pdf generates a PDF. The default is native.

Where to save

Leave these inputs out to save the document to the record's Salesforce Files. To save it in a folder instead, give folderId and library together.

InputRequiredDescription
folderIdWith libraryThe ID of the folder to save the document in. With the library salesforce, the ID of the Salesforce record to save it on.
libraryWith folderIdThe library the folder is in: sharepoint, onedrive, google, box, dropbox, s3, azure, azurefiles, msteams, sftp, cloudfiles, salesforce. For an additional SharePoint connection, use sharepoint__ followed by the connection's API name.
driveIdFor libraries with drivesThe drive the folder is in, for libraries that have drives, such as SharePoint.

PDF and preview options

The PDF options apply only when outputFormat is pdf.

InputRequiredDescription
lockPdfNoStops the PDF from being edited.
pdfViewPasswordNoThe password needed to open the PDF, up to 128 characters.
pdfOwnerPasswordNoThe password needed to change the PDF's permissions, up to 128 characters.
allowPdfPrintingNoWhether the PDF can be printed.
allowFillingPdfFormFieldsNoWhether the PDF's form fields can be filled.
allowDownloadInPreviewNoWhether the CloudFiles viewer offers a download. The default is true.
allowPrintInPreviewNoWhether the CloudFiles viewer offers printing. The default is false.

Signing

InputRequiredDescription
sendForSigningNoSends the document to the template's signers through DocuSign as soon as it is generated. The default is false: a document whose template names signers then waits for approval until send-for-signing is called or someone clicks Approve on the record page.

Outputs

generate-document answers as soon as the document is started, with these fields.

FieldDescription
documentIdThe document's ID, for get-document-status and send-for-signing.
statusgenerating, because the document is still being made.
recordIdThe Salesforce record the document is filled from.

The document's file name, where it is saved, its preview and download links, its signing details and, if it fails, the reason come later, from get-document-status.

Example requests

You askWhat the agent does
Generate the renewal quote for this account.Calls generate-document with the template and the account's record ID, then get-document-status until the document is ready, and shares the preview and download links.
Generate the NDA with a three-year term.Calls generate-document and passes the term as the value of the template's variable.
Make it a locked PDF with a view password.Calls generate-document with outputFormat set to pdf, lockPdf and pdfViewPassword.
Let me review it before it goes out for signing.Calls generate-document without sendForSigning, shares the preview link and the signers, and calls send-for-signing only after you confirm.
A Claude conversation where the user asks which templates fit a Salesforce Account, picks one, and Claude generates the document and shares its preview and download links.
A Claude conversation where the user asks which templates fit a Salesforce Account, picks one, and Claude generates the document and shares its preview and download links.