1. Flow and Apex Integration
360 InstantDocs provides an Invocable Action that can be called from Salesforce Flows, Process Builder, or Apex code. This enables automated document generation as part of your business processes.
When to Use Flow/Apex Integration:
- Auto-generate welcome letters when new Accounts or Contacts are created
- Trigger contract generation automatically when an Opportunity stage changes to “Closed Won”
- Generate approval documents as part of an approval process flow
- Schedule recurring document generation via scheduled flows (e.g., weekly status reports)
1.1 Using the Invocable Action in Flow
1Open Salesforce Flow Builder (Setup → Flows → New Flow).
2Add an Action element to your flow.
3Search for “Create Document Manager” (or “createDocumentManagers”) in the action search.
4Select the 360 InstantDocs – Create Document Managers invocable action.
5Configure the input parameters (see Section 1.2 below).
6Optionally, capture the output parameters to track the result.
7Connect the action element to the rest of your flow logic.
8Save and activate the flow.
1.2 Input / Output Parameters
Input Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
templateId |
Yes | Id (Text) | The record ID of the x360dc__Template__c record to use for document generation |
parentRecordId |
Yes | Id (Text) | The record ID of the parent Salesforce record (the record the document is being generated for) |
parentObjectName |
Yes | Text | The API name of the parent object (e.g., “Opportunity”, “Account”, “Custom_Object__c”) |
documentType |
Yes | Text | The output format: “Doc” (DOCX) or “Pdf” (PDF). Defaults to the template’s configured type if not specified. |
Output Parameters
| Parameter | Type | Description |
|---|---|---|
documentManagerId |
Id (Text) | The record ID of the created x360dc__X360_Document_Manager__c record |
isSuccess |
Boolean | true if the document generation was initiated successfully, false otherwise |
errorMessage |
Text | Error details if isSuccess is false. Empty string if successful. |
Tip: The invocable action supports bulk input — you can pass multiple records in a single flow loop. Each input creates a separate Document Manager record and triggers generation independently.
Note: When triggered from Flow, the
Created_From field on the Document Manager record is set to “Flow/Apex”, making it easy to distinguish automated generations from user-initiated ones in reports and list views.