Flow Reference
Choose the right S-Docs action in Flow Builder, then use current API details, limits, and best practices for each action.
Use this page when you need the right S-Docs action in Flow Builder.
Architectural context and limits
Design these actions around transaction boundaries first.
These invocable actions are Apex-backed actions executed by Flow.
Treat them as production transaction participants.
Bulkification behavior
Flow can invoke Apex actions with
List<Input>payloads in bulk contexts.Architect flows for bulk entry points first.
Do not assume each action batches SOQL, DML, or callouts safely.
Avoid calling these actions inside deep loops.
Prefer collection-based handoff when available.
Use Generate Documents in Batch for high-volume runs.
Use batch generation when you need queued execution or fresh governor context.
Prefer
SDOC__GenerateBatchInvocablewhen one flow can fan out across many records or templates.
Error handling and fault paths
Use Flow Fault paths on every action.
Treat failures as Apex exceptions in the Flow transaction.
Do not treat outputs as a general error channel.
Do not assume every action exposes a standard error output contract.
For asynchronous actions, a successful Flow step only confirms queueing.
Monitor queued jobs separately for runtime failures.
Persist failure context when possible.
Log record ID, action name, interview ID, and exception message when possible.
Transaction and callout constraints
A flow can fail after DML and then a callout.
Salesforce can throw
uncommitted work pendingin that pattern.Split transaction phases explicitly when chaining envelope actions.
Use a Screen, Pause/Wait, or Asynchronous Path when needed.
Architectural warning: A flow that works for one record can still fail at scale because of callout timing, CPU time, heap size, or SOQL limits.
Invocable Actions List
Generate Document — Generate one document from one base record.
Send Email — Send documents with an S-Docs email template.
Generate S-Doc With Input — Pass Screen Flow inputs into generation.
Prepare Envelope — Build the envelope payload for signing.
Seal Envelope — Finalize the envelope and return the signing link.
Refresh Document Data — Refresh an existing S-Doc with current record data.
Generate Documents in Batch — Queue bulk generation across many records or templates.
Combine Documents — Merge multiple S-Docs into one combined output.
Create PDF File from S-Doc — Convert an S-Doc record into a PDF file.
Related Flow Screen Components
Use these when a Flow step needs user interaction.
Live Edit Screen — Let users edit a generated document in a Flow screen.
Email Editor Screen — Let users review email content in a Flow screen.
Document Viewer Screen — Let users view an S-Doc PDF in a Flow screen.
Invocable Actions List
Generate Document
Use this action to generate one document from one base record.
Flow Builder label: Generate Document
API name:
SDOC__GenerateDocumentInvocableCommon output:
sdocIdNotes: Supports guest-user generation in Experience Cloud.
Notes: Supports component templates with
<LineItems>related lists.Implementation guide: Use Getting Started: Automate Document Generation for org-level generation patterns.
Inputs
enforceSharingRules
BOOLEAN
No
1
System Mode Generation (Experience Cloud)
Grants unauthenticated or logged-in Experience Cloud users system-level permissions for generation events.
recordId
ID
Yes
1
Base Record ID
ID of base record used in generation.
templateId
ID
No
1
Template ID
If selecting by template name, do not use this field.
templateName
STRING
No
1
Template Name
Name of template used in generation.
Outputs
contentDocumentId
STRING
1
Generated ContentDocument ID
ID of generated ContentDocument.
fileName
STRING
1
Generated File Name
Name of generated file.
sdocId
STRING
1
Generated SDoc ID
ID of generated SDoc.
Technical specifications and best practices
Execution context: Synchronous. Document generation consumes limits in the active transaction.
Data formatting: Provide either
templateIdortemplateNameconsistently.Data formatting: Avoid setting both unless your org-standard wrapper defines precedence.
Experience Cloud behavior:
enforceSharingRulestoggles system-mode behavior for Experience Cloud generation paths.Fault handling: Use Flow Fault paths for exceptions.
Apex SDK equivalent: Use S-Docs generation APIs in Apex when you need custom pre-validation, branching, or transaction orchestration.
Send Email
Use this action to send documents with an S-Docs email template.
Flow Builder label: Send Email
API name:
SDOC__EmailInvocableCommon output:
sendSuccessfulNotes: Supports guest-user generation in Experience Cloud.
Implementation guide: Use Send Email from Flow for email template, attachment, and delivery setup.
Inputs
attachmentIds
ID
No
2000
Attachments
ID(s) of attachment(s) to include in the email.
bccAddress
STRING
No
2000
BCC Recipient Email Address
BCC address(es) to send the email to.
ccAddress
STRING
No
2000
CC Recipient Email Address
CC address(es) to send the email to.
enforceSharingRules
BOOLEAN
No
1
System Mode Generation (Experience Cloud)
Grants unauthenticated or logged-in Experience Cloud users system-level permissions for generation events.
orgWideAddress
STRING
No
1
Org-Wide Email Address
Org-wide address of the email.
recordId
ID
Yes
1
Base Record ID
ID of base record to be used with template.
subject
STRING
No
1
Subject Line
Subject of the email.
templateNameOrId
STRING
Yes
1
S-Docs Email Template Name or ID
Name or ID of template to be used in the email.
toAddress
STRING
No
2000
Recipient Email Address
Address(es) to send the email to.
Outputs
sendSuccessful
BOOLEAN
1
Send Successful
Indicates whether the email was successfully sent.
Technical specifications and best practices
Execution context: Synchronous. Email composition and send logic executes in the current transaction context.
Data formatting: Multi-value inputs use repeatable values.
Data formatting: Use Flow Text Collections for
attachmentIds,toAddress,ccAddress, andbccAddress.Template resolution:
templateNameOrIdis required.Template resolution: Combine it with
recordIdto resolve merge context deterministically.Fault handling: Even though
sendSuccessfulis returned, wire a Flow Fault path.Apex SDK equivalent: Use S-Docs email Apex APIs when you need advanced recipient validation, conditional attachments, or custom delivery telemetry.
Generate S-Doc With Input
Use this action to pass Screen Flow inputs into generation.
Flow Builder label: Generate S-Doc With Input
API name:
SDOC__UserInputInvocableCommon output:
sdocNotes: Supports guest-user generation in Experience Cloud.
Notes: Use
sdoc.Idin later Flow steps when you need the generated record ID.Implementation guide: Use User Input to define and map runtime inputs.
If you need setup steps for userInputs, use User Input.
Inputs
enforceSharingRules
BOOLEAN
No
1
System Mode Generation (Experience Cloud)
Grants unauthenticated or logged-in Experience Cloud users system-level permissions for generation events.
objectId
ID
Yes
1
Object Id
ID of object used in generation.
templateNameOrId
STRING
Yes
1
Template Name or Id
Name or ID of template used in generation.
userInputs
(unspecified by API metadata)
Yes
2000
User Inputs
User inputs for merge fields used in generation.
Outputs
sdoc
SOBJECT
1
Generated SDoc__c
The generated SDoc__c object.
Technical specifications and best practices
Execution context: Synchronous. Merge and generation occur inside the current transaction.
Data formatting:
userInputsis Apex-defined asSDOC__UserInput.Data formatting: Map Flow inputs to the expected Apex-defined type structure.
Data formatting: Do not pass raw JSON or raw text in place of the expected structure.
Template binding:
templateNameOrIdandobjectIdare both required.Fault handling: Route all exceptions through a Flow Fault path.
Apex SDK equivalent: Use S-Docs user-input generation APIs in Apex for custom coercion or validation of complex field-level input maps.
Prepare Envelope
Use this action to create the envelope payload for signing.
Flow Builder label: Prepare Envelope
API name:
SDOC__PrepareEnvelopeInvocableCommon output:
envelopeIdNotes: Supports in-person signing flows.
Implementation guide: Use How S-Sign Generates Envelopes to design your signing workflow.
Inputs
sdocIdsString
STRING
Yes
1
SDoc IDs
Comma-separated list of SDoc IDs to include in the envelope.
signInPerson
BOOLEAN
No
1
Sign in Person
Set true for in-person signing use cases.
Outputs
envelopeId
ID
1
Envelope ID
ID of created envelope.
Technical specifications and best practices
Execution context: Synchronous. Envelope assembly executes in the current transaction.
Data formatting:
sdocIdsStringis a single comma-separated string.Data formatting: Do not pass a native collection input here.
Transaction sequencing: If Seal Envelope follows immediately, add a transaction boundary before sealing.
Fault handling: Wire a Flow Fault path.
Fault handling: Log
sdocIdsStringandsignInPersonwhen you need replay support.Apex SDK equivalent: Use S-Docs or S-Sign envelope preparation APIs in Apex when you need signer-rule enrichment or custom validation before seal or send.
Seal Envelope
Use this action to finalize the envelope and return the signing link.
Flow Builder label: Seal Envelope
API name:
SDOC__SealEnvelopeInvocableCommon output:
signingLinkNotes: Run this in a separate transaction from Prepare Envelope.
Implementation guide: Use How S-Sign Generates Envelopes to map the full envelope lifecycle.
Inputs
envelopeId
ID
Yes
1
Envelope ID
ID of envelope to seal.
Outputs
signingLink
STRING
1
Signing Link
Signing link of the envelope.
Technical specifications and best practices
Execution context: Synchronous. Runs in the current Flow transaction.
Transaction control requirement: Do not assume same-transaction chaining is safe after
SDOC__PrepareEnvelopeInvocable.Data formatting: Pass
envelopeIdas one valid Salesforce ID.Data formatting: Do not pass collections or CSV.
Error handling: Capture exceptions through a Flow Fault path.
Error handling: Do not rely on a blank or null
signingLinkas your only failure check.Apex SDK equivalent: Invoke S-Docs or S-Sign envelope APIs directly in Apex when you need explicit retries or idempotency controls.
Architectural warning: If your flow performs DML before sealing, you can hit
uncommitted work pendingcallout errors.Required Flow pattern for Prepare → Seal: place a transaction boundary between the two actions by using a Screen, Pause/Wait, or Asynchronous Path before
SDOC__SealEnvelopeInvocable.
Refresh Document Data
Use this action to refresh an existing S-Doc with current record data.
Flow Builder label: Refresh Document Data
API name:
SDOC__RefreshDocumentDataInvocableCommon output:
sdocIdNotes: Keep the Flow aligned with the template base object.
Implementation guide: Use Refresh Documents with Flow for refresh behavior and document runtime setup.
Inputs
enforceSharingRules
BOOLEAN
No
1
System Mode Generation (Experience Cloud)
Grants unauthenticated or logged-in Experience Cloud users system-level permissions for generation events.
sdocId
ID
Yes
1
S-Doc ID
ID of S-Doc record to refresh.
Outputs
sdocId
STRING
1
Refreshed SDoc ID
ID of refreshed SDoc.
Technical specifications and best practices
Execution context: Synchronous. Refresh work executes in the active Flow transaction.
Data formatting:
sdocIdis a single ID input.Data formatting: For mass refresh scenarios, iterate carefully or use batch-oriented orchestration.
Experience Cloud behavior:
enforceSharingRulescontrols system-mode generation behavior for Experience Cloud contexts.Fault handling: Implement a Flow Fault path.
Fault handling: Treat output
sdocIdas success data, not as an error envelope.Apex SDK equivalent: Use S-Docs refresh APIs from Apex for controlled retries and bulk-aware orchestration patterns.
Generate Documents in Batch
Use this action to queue bulk document generation.
Flow Builder label: Generate Documents in Batch
API name:
SDOC__GenerateBatchInvocableCommon output:
jobIdNotes: Supports combined output.
Notes: Supports collated or non-collated output order.
Implementation guide: Use Batching Documents for bulk setup patterns and limits.
Inputs
batchSize
INTEGER
No
1
Batch Size
Number of records to process in each batch.
collateCombined
BOOLEAN
No
1
Collate Combined Documents
Sort documents in the combined document to collate by base object.
combineAll
BOOLEAN
No
1
Combine Documents
Combine all generated documents into one PDF.
combinedFileLocations
ID
No
2000
Combined Document File Locations
IDs for records or libraries to create ContentDocumentLink rows for the combined document.
combinedFileName
STRING
No
1
Combined Document File Name
Name for combined output. Defaults to Combined Document.
enforceSharingRules
BOOLEAN
No
1
Deprecated
Deprecated.
recordIds
STRING
Yes
2000
Base Record IDs
ID(s) of base record(s) used in generation.
templateIds
STRING
Yes
2000
Template IDs
ID(s) of template(s) used in generation.
Outputs
jobId
ID
1
Batch Job ID
ID of the queued Batch Job.
Technical specifications and best practices
Execution context: Asynchronous. This action enqueues an Apex batch job and returns
jobIdimmediately.Bulkification behavior: Use this action for record collections and high-volume generation.
Bulkification behavior: Prefer it over repeated synchronous generation calls in loops.
Data formatting: Pass
recordIds,templateIds, andcombinedFileLocationsas Flow collections.Data formatting: Do not collapse multiple IDs into one comma-separated string unless your implementation intentionally parses CSV upstream.
Governor strategy: Tune
batchSizeto balance throughput against row-level automation overhead.Governor strategy: Reduce batch size if the job hits SOQL, CPU, or heap limits.
Deprecated input:
enforceSharingRulesis marked Deprecated.Best practice: Do not use template-level Document Actions with batch generation.
Monitoring: Use
jobIdto track status in Setup → Apex Jobs or throughAsyncApexJob.Error handling: Use a Flow Fault path for queueing failures.
Error handling: Check the queued job for failures that happen after the Flow step completes.
Apex SDK equivalent: Method: generateDocsInBatch
Architectural warning: A successful Flow step only confirms that the batch job was queued. It does not confirm that document generation finished successfully.
Combine Documents
Use this action to merge existing S-Docs into one combined output.
Flow Builder label: Combine Documents
API name:
SDOC__CombineDocumentsInvocableCommon output:
sDocIdsNotes: Use this after documents already exist.
Implementation guide: Use Combining Documents for merge patterns and output planning.
Inputs
combinedFileLocations
ID
No
2000
Combined Document File Locations
Enter IDs for records or libraries for which to create ContentDocumentLink rows to the generated combined document.
combinedFileName
STRING
No
1
Combined Document File Name
Enter the file name for the combined document output. Defaults to Combined Document.
sdocIds
STRING
Yes
2000
S-Doc Ids
IDs of the S-Docs to combine.
Outputs
sDocIds
STRING
2000
Combined S-Docs
The combined S-Doc ID or IDs.
Technical specifications and best practices
Execution context: Synchronous. Runs in the current Flow transaction.
Data formatting:
sdocIdsis typed asSTRINGwithmaxOccurs=2000.Data formatting: Pass a Flow Text Collection of S-Doc IDs rather than one comma-separated string unless you intentionally build and parse CSV.
Linking output:
combinedFileLocationsaccepts up to 2000 IDs for file linking.Fault handling: Configure a Flow Fault path.
Fault handling: Do not assume partial success signaling through outputs.
Apex SDK equivalent: Use S-Docs combine or merge APIs from Apex when you need custom ordering, partitioning, or retry behavior.
Create PDF File from S-Doc
Use this action to turn an S-Doc record into a PDF file.
Flow Builder label: Create PDF File from S-Doc
API name:
SDOC__FileCreationInvocableCommon output:
fileNotes: This step is rarely used unless after Refreshing Documents.
Inputs
sdocId
ID
Yes
1
S-Doc Id
ID of S-Doc to generate a PDF file from.
Outputs
file
SOBJECT
1
Generated File
The generated PDF file.
Technical specifications and best practices
Execution context: Synchronous. File generation runs in the same transaction as the calling Flow interview.
Data formatting:
sdocIdmust be one valid S-Doc record ID.Output handling: Returned
fileis anSOBJECT.Output handling: Map only the fields you need downstream.
Fault handling: Use a Flow Fault path for generation failures.
Apex SDK equivalent: Use S-Docs file generation Apex APIs when you need deterministic post-processing, renaming, extra linking, or retention policies.
Related Flow Screen Components
Live Edit Screen
Use this component to let users edit a generated document.
Flow Builder label: S-Docs Live Edit
API Name:
SDOC__documentEditorModalDescription: Add the S-Docs Live Editor component to let users edit documents generated through the S-Docs managed package.
Implementation guide: Use Editing Generated Documents (Live Edit) for setup steps.
Inputs
sdocId
String
No*
1
S-Doc Id
S-Doc record ID used by the editor to load the document to edit.
* sdocId is not explicitly marked required in targetConfig metadata.
Treat it as operationally required for predictable runtime behavior.
Outputs
(none declared)
This component does not declare Flow output properties in metadata.
Error handling
Add a Flow Fault path on the screen element that hosts this component.
Add a Flow Fault path on downstream actions that depend on successful edit completion.
Validate
sdocIdbefore entering the screen.Missing or invalid IDs usually surface as runtime component errors.
Log record ID, interview ID, and component API name in your fault path.
Technical specifications and best practices
Component type: Flow screen LWC with
lightning__FlowScreen.Namespace:
SDOC.Execution context: Runs in the user-interactive Flow screen transaction.
Data contract: Accepts one string input and declares no output contract.
Flow design: Treat completion as UI-driven.
Flow design: Branch flow logic explicitly after the screen.
Security context: Runtime behavior follows Flow context, user access, and package permissions.
Design guidance: Use this component when users must review or edit before email, envelope, or downstream automation steps.
Email Editor Screen
Use this component to let users review email content in a Flow screen.
Flow Builder label: S-Docs Email Screen
API Name:
SDOC__emailEditorModalDescription: Add the S-Docs Email Screen component to let users email documents generated through the S-Docs managed package.
Implementation guide: Use Email Editor for screen setup and attachment flow.
Inputs
modalTitle
String
No
1
Modal Title
Title shown in the email editor modal.
emailTemplate
String
No
1
Email Template
Template reference used to prepopulate email content.
emailBody
String
No
1
Email Body
Initial email body text shown in the editor.
emailSubject
String
No
1
Email Subject
Initial subject value for the outbound message.
emailTo
String
No
1
Email To Address
Recipient email address string.
emailFrom
String
No
1
Email From Org Wide Id
Org-wide email ID used as sender context.
emailCC
String
No
1
Email CC Address
CC email address string.
lockEmailBody
Boolean
No
1
Lock Email Body
Locks body editing when true.
lockEmailSubject
Boolean
No
1
Lock Email Subject
Locks subject editing when true.
lockEmailTo
Boolean
No
1
Lock Email To Address
Locks To field editing when true.
lockEmailFrom
Boolean
No
1
Lock Email From Address
Locks From field editing when true.
lockEmailCC
Boolean
No
1
Lock Email CC Address
Locks CC field editing when true.
emailAttachmentsString
String
No
1
Comma Separated Content Version Ids to Attach
Comma-separated ContentVersion IDs to attach.
sDocsAttachmentsString
String
No
1
Comma Separated S-Doc Ids to Attach
Comma-separated S-Doc IDs to attach.
recordId
String
No*
1
Record Id
Context record ID used for merge and email behavior.
* recordId is not explicitly marked required in targetConfig metadata.
Treat it as operationally required when merge context depends on a base record.
Outputs
(none declared)
This component does not declare Flow output properties in metadata.
Error handling
Use Flow Fault paths on downstream automation actions.
This component does not expose structured error outputs.
Validate email addresses upstream.
Validate
emailFromsender configuration upstream.Validate attachment ID strings upstream.
Ensure comma-separated attachment IDs are correctly formatted.
Ensure the running user can access attached records and files.
Technical specifications and best practices
Component type: Flow screen LWC with
lightning__FlowScreen.Namespace:
SDOC.Execution context: Runs as a user-interactive screen component in Flow runtime.
Data contract: All declared properties are inputs.
Data contract: No metadata-declared outputs are available.
Formatting constraints:
emailAttachmentsStringandsDocsAttachmentsStringare comma-separated strings.Formatting constraints: Do not treat these fields as native Flow collections.
Design guidance: Treat this component as a configuration and input-capture screen.
Design guidance: Pair it with explicit post-screen validation and downstream fault handling.
Document Viewer Screen
Use this component to show an S-Doc PDF in a Flow screen.
Flow Builder label: S-Docs Document Viewer
API Name:
SDOC__viewDocumentDeveloper name:
viewDocumentDescription: LWC to view an S-Doc PDF via an iframe.
Inputs
recordId
String
Yes
1
SDoc ID
The Salesforce ID of the SDoc__c record to view.
Outputs
(none declared)
This component does not declare Flow output properties in metadata.
Error handling
Validate
recordIdbefore the screen loads.Missing or invalid IDs can surface as runtime component errors.
Ensure users can access the target S-Doc and related file records.
Add Flow Fault paths on downstream steps that depend on this screen.
Technical specifications and best practices
Component type: Flow screen LWC with
lightning__FlowScreen.Namespace:
SDOC.Execution context: Runs in a user-interactive Flow screen.
Flow usage: Pass the
SDOC__SDoc__crecord ID intorecordId.Rendering behavior: The component renders a PDF viewer through an iframe.
Security context: Users need access to the underlying S-Doc and file records.

