# Flows Reference

The S-Docs package offers a powerful suite of prebuilt invocable Apex actions designed to seamlessly execute SDK methods within Salesforce Flow Builder. This comprehensive library encompasses the major milestones of the document lifecycle.

By leveraging these invocable actions, Salesforce Administrators and Developers can streamline document management processes natively within Flow Builder, eliminating the need for extensive custom development. Whether your workflow requires generating documents in bulk, distributing them via email, or gathering secure eSignatures, the S-Docs invocable actions provide a straightforward, drag-and-drop solution. Exploring and adopting these actions will significantly enhance productivity and maximize the value of your Salesforce environment.

To access these actions, navigate to the Salesforce **Flow Builder**, **Add** an **Element**, and select **Action**.

Search and select the **S-Docs** category in the right sidebar.

Select your desired action.

<table data-header-hidden data-full-width="true"><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Action Name</strong></td><td><strong>API Name</strong></td><td><strong>Description</strong></td><td><strong>Key Inputs</strong></td><td><strong>Output Variable</strong></td><td><strong>Important Notes</strong></td></tr><tr><td>Generate Document</td><td><code>apex-SDOC__GenerateDocumentInvocable</code></td><td>Generates PDF documents from a base record using a configured S-Docs template.</td><td>Base Record ID, S-Doc Template ID</td><td><code>{!Generate_Document.sdocId}</code></td><td>Spring '25: Supports component templates with <code>&#x3C;LineItems></code> related lists and Guest User generation in Experience Cloud.</td></tr><tr><td>Generate Documents in Batch</td><td><code>apex-SDOC__GenerateBatchInvocable</code></td><td>Defines multiple base record IDs or Template IDs to bulk generate PDFs.</td><td>List of Base Record IDs and/or List of S-Doc Template IDs</td><td><code>{!Generate_in_Batch.jobId}</code></td><td>Spring '25: Supports output sorting options (Disabled = Not Collated; Enabled = Collate).</td></tr><tr><td>Combine Documents</td><td><code>apex-SDOC.CombinedDocumentHandler()</code></td><td>Combines generated documents into one final PDF output.</td><td>Comma-delimited list of S-Doc File IDs, Optional File Name</td><td>None specified</td><td>Available starting with the Fall '25 release.</td></tr><tr><td>Generate S-Doc With Input</td><td><code>apex-SDOC__UserInputInvocable</code></td><td>Incorporates real-time user inputs from Screen Flows into document generation.</td><td>Object (Base Record) ID, Template Name or ID, User Inputs (Collection Variable)</td><td><code>{!Generate_with_Input.sdocId}</code></td><td>Spring '25: Supports Guest User generation in Experience Cloud.</td></tr><tr><td>Prepare Envelope</td><td><code>apex-SDOC__PrepareEnvelopeInvocable</code></td><td>Gathers signature documents and supplemental materials for eSignature execution flows.</td><td>Signature documents and supplemental materials</td><td><code>{!Prepare_Envelope.envelopeId}</code></td><td>Spring '25: Supports defining Sign In-Person events for SDK-generated requests.</td></tr><tr><td>Seal Envelope</td><td><code>apex-SDOC__SealEnvelopeInvocable</code></td><td>Finalizes eSignature envelopes for secure distribution.</td><td>Data generated from the Prepare Envelope transaction</td><td><code>{!Seal_Envelope.signingLink}</code></td><td>Output provides a secure link for in-person signing or emailed requests. Must be a separate transaction from Prepare Envelope.</td></tr><tr><td>S-Docs Email</td><td><code>apex-SDOC_EmailInvocable</code></td><td>Leverages S-Docs email templates in flows to activate emailing capabilities natively.</td><td>S-Docs Email Template parameters</td><td>None specified</td><td>Spring '25: Supports Guest User generation in Experience Cloud.</td></tr><tr><td>Document Data Refresh</td><td><code>apex-SDOC_RefreshDocumentDataInvocable</code></td><td>Automatically refreshes generated documents when data updates occur in associated records.</td><td>Record data associated with the original template</td><td><code>{!Generate_Document.sdocId}</code></td><td>Keep flow logic aligned with template base objects.</td></tr><tr><td>Create PDF File from S-Doc <em>(Bonus from Tutorial)</em></td><td>N/A</td><td>Generates the actual PDF file from the S-Doc record.</td><td>S-Doc ID (e.g., Output from Generate action)</td><td>None specified</td><td>Used in conjunction with generation actions like Generate S-Docs With Input.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/developer-hub/document-generation-workflows/apex-and-programmatic-automation/reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
