> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/s-sign/automation-and-envelope-lifecycle/automate-e-signature-with-flow-builder/automate-e-signature-in-batch.md).

# Automate E-Signature in Batch

This page will walk the user through setting up a Automated Batch Process for E-Signature solutions. We will accomplish this by setting up 2 Flows, one screen flow and one record-triggered Flow.

{% columns %}
{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2FfDEBtLlwI78csRMGM7RS%2Fimage.png?alt=media&amp;token=e2b77c24-9435-4bc2-830d-bf4b81ac6502" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2FKdQWhi6BvHdm5GbzZFzw%2Fimage.png?alt=media&amp;token=a4a56202-4511-4ee5-8b45-4ee2de2771de" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### Understanding the Overall Schema

Outlined above is the generalized process from start to finish users will take to generate an S-Sign Request using a Record Triggered Flow.

The process goes as follows:

1. **Collect Data** that will be used for document generation (S-Sign Enabled Template + Object Record)
2. **Generate the document** from the collected data
3. **Prepare the Envelope** the Generated Document will be stored in
4. **Seal the Envelope** in preparation to deliver the request
5. **Send** out the request for Electronic Signature

This use case is more unique, considering we couple the use of a **Screen Flow** to do the data collection and document generation in batch, then leverage a **record-triggered after save flow** to create, seal, and deliver the envelope.

***

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2F70f8HFtkN3aXistJToer%2Fimage.png?alt=media&amp;token=5e69a57c-5519-4547-9ff2-6dd74b0d1937" alt="" width="375"><figcaption></figcaption></figure>

### Phase 1: Configure the Batch Generation

In large the screen flow is our standard document generation steps through flows. With batch generation, the key characteristic that needs to be focused on is the input variables. **The Base Record IDs and Template IDs inputs only accept Collection variables.** After we use the Get Records Invocable Actions to find the data we want to generate, we will use the assignment variable to assign both the templates and object records to collections. Then we feed the collections into the Generate in Batch Invocable Action.

***

### Phase 2: Construct the Record-Triggered Flow

1. Build the Flow using the process outlined at the beginning of this article and detailed further in [Send E-Signature Requests from a Record-Triggered Flow](https://help.sdocs.com/s-sign/automation-and-envelope-lifecycle/automate-e-signature-with-flow-builder/send-e-signature-requests-from-a-record-triggered-flow)
2. Ensure all Invokable Actions are added to the **Asynchronous Path**
3. Do not include any invokable actions that are included in **Phase 1**
4. Add the **Triggering S-Doc ID** to the collection, this will be provided to the **Attachments** option in the **Send Email** invocable action&#x20;

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2FyQdyNwIsFRC6oYdUMkYJ%2Fimage.png?alt=media&amp;token=5f899ff6-e3b4-492f-b1e7-52dd2af859c7" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Record-Triggered Flows will batch all qualifying records into a single transaction. Restrict the number of S-Docs generated in Phase 1 to avoid encountering Salesforce Governor Limits.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sdocs.com/s-sign/automation-and-envelope-lifecycle/automate-e-signature-with-flow-builder/automate-e-signature-in-batch.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
