> 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.md).

# Automate E-Signature with Flow Builder

This page will walk our S-Docs Users through constructing a screen flow that will allow for Document Generation, Envelope Creation, and Electronic Delivery, a guide to Automate E-Signature requests

***

{% columns %}
{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2F8tYXpOj1A5aw6f8gxaBe%2Fimage.png?alt=media&amp;token=b9115621-406f-47ad-93a8-13b525318abd" alt="" width="194"><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%2F299tZML5eOt7oujO5IzL%2Fimage.png?alt=media&amp;token=fcf1273e-b7fc-46b6-8312-da0a47878e3e" alt="" width="158"><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.

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

{% hint style="info" %}
The process outlined throughout this guide will be mimicked for generic auto-launched flows.
{% endhint %}

***

### Phase 1: Collect the Data

{% columns %}
{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2F5ZVEIoiKiFctolZkNxT8%2Fimage.png?alt=media&amp;token=73d3243f-948e-46d8-82d5-2efa8ebc6f98" alt="" width="368"><figcaption></figcaption></figure>

Use the **Get Records** Invocable Action to gather the object record. Use Filters to limit what records are collected.

{% hint style="info" %}
If the flow is initiated by a LWC or Button on the object record, create and use the {!recordId} standard resource from Salesforce. For more information, please visit Salesforce's Article here: <https://help.salesforce.com/s/articleView?id=service.omnichannel_create_recordid.htm&type=5>
{% endhint %}
{% endcolumn %}

{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2Fhe2UM1OcvnyP6Phi0nKx%2Fimage.png?alt=media&amp;token=2e4de900-f9b7-4f57-b65c-3e7ce0fd73e0" alt="" width="375"><figcaption></figcaption></figure>

Use the **Get Records** Invocable Action to gather the S-Docs Template. Use Filters to limit which record is collected.

{% hint style="info" %}
Template IDs are unique to an Organization. If migrating templates from one Organization to another, be sure to change the ID within the Flow.
{% endhint %}
{% endcolumn %}
{% endcolumns %}

***

### Phase 2: Generate the Document

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2F0csmEVWULqjPHbOvJHil%2Fimage.png?alt=media&amp;token=ed2ec0fe-29b1-4272-88da-8f75703a704a" alt="" width="254"><figcaption></figcaption></figure>

Using the **Generate Document** Invokable Action, provide the **Base Record ID** and the **S-Docs Template ID** gathered in **Phase 1**.

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2Fh6gtIuun5eZetF1Y7FnL%2Fimage.png?alt=media&amp;token=54382452-f0c7-441e-826b-2853e8d27fe3" alt="" width="334"><figcaption></figcaption></figure>

Create a new variable named **SSLinkGeneration**

* Create: **Variable**
* Data Type: **Text**
* Check: **Allow Multiple values (collection)**

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2F4KycTpu9tYluT0dThhKJ%2Fimage.png?alt=media&amp;token=5c947f6c-dea0-4002-8597-cca34bcd3a60" alt="" width="311"><figcaption></figcaption></figure>

Using the Assignment Action, assign the **Generated S-Docs ID** that was generated in previously to the collection. The SSLinkGeneration collection will be provided as an attachment when the email is delivered.

***

### Phase 3: Create the Envelope, Seal the Envelope

{% columns %}
{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2Fw884AiYGkn5jf9CzbIOM%2Fimage.png?alt=media&amp;token=c06a67be-2f5f-43ed-bd91-453c7370173d" alt="" width="248"><figcaption></figcaption></figure>

Using the **Prepare Envelope Invocable Action**, store the **Generated S-Docs ID** from **Phase 2**

Under **Advanced Options** set the **Transaction Control** to **Always start a new transaction**
{% endcolumn %}

{% column %}

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2FpVI3xp7fPN476PzheaBl%2Fimage.png?alt=media&amp;token=d6b3af6b-b45a-4681-b504-626a02bb454c" alt="" width="249"><figcaption></figcaption></figure>

Using the **Seal Envelope Invocable Action**, store the **Envelope Id** from the previous step.

Under **Advanced Options** set the **Transaction Control** to **Always start a new transaction**
{% endcolumn %}
{% endcolumns %}

***

### Phase 4: Deliver the E-Signature Request

<figure><img src="https://2828008455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG8JG5qkkPJ4Es3cSKC5u%2Fuploads%2FyCXjlLnaBC745dgWpfWy%2Fimage.png?alt=media&amp;token=dfab721c-ea3a-4262-8ee3-f74e745adf55" alt="" width="311"><figcaption></figcaption></figure>

Using the **Send Email Invocable Action**, provide the **Base Record ID**, the &#x53;**-Sign Enabled Email Template**, and the **SSLinkGeneration** collection. The **Recipients Email Address** will be pulled from the email defined by the **Signer Profile** within the S-Docs Template.

### Advanced configurations and reference

* Field-level action details: [Flow Reference (Prepare Envelope)](/developer-hub/document-workflows/flow-reference.md#prepare-envelope)
* Field-level action details: [Flow Reference (Seal Envelope)](/developer-hub/document-workflows/flow-reference.md#seal-envelope)
* **Prepare Envelope** must receive the generated document from your earlier step.
* **Seal Envelope** returns the `signingLink` output.


---

# 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.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.
