# Automate E-Signature with Flow Builder

***

{% columns %}
{% column %}

<figure><img src="/files/j5UAw4iDenjiFyOg0uEb" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="/files/izMD4Mv6BYj9cjb4632F" 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.&#x20;

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.&#x20;
{% endhint %}

***

### Phase 1: Collect the Data

{% columns %}
{% column %}

<figure><img src="/files/7yaGMDUsS5xED7yyJWv9" alt=""><figcaption></figcaption></figure>

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

{% 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="/files/JLAYxtJIcGTJgH2DW1MX" alt=""><figcaption></figcaption></figure>

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

{% 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.&#x20;
{% endhint %}
{% endcolumn %}
{% endcolumns %}

***

### Phase 2: Generate the Document

<figure><img src="/files/12kAyY6vtN3AECttlw5J" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/b40TdQ6aVVGHr4rNr4wy" alt=""><figcaption></figcaption></figure>

Create a new variable named **SSLinkGeneration**

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

<figure><img src="/files/n1XjMtSIJPYqt4OysDSH" alt=""><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.&#x20;

***

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

{% columns %}
{% column %}

<figure><img src="/files/202cIaBZRFXTBYPv4Wz5" alt=""><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="/files/vz98UKWNoZXNAiQCkdwy" alt=""><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="/files/bgYV2Uj0c1J8GosTAbQz" alt=""><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.&#x20;


---

# 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/s-sign/automation-and-envelope-lifecycle/automate-e-signature-with-flow-builder.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.
