đŹ Automate rental agreements with BoldSign, Google Sheets & Gemini AI
⥠97 views · đŹ Document Extraction & Analysis
Description
Complete Video Documentation: https://youtu.be/O-bKlX3G7_4
Explanation WITH clean Video timestamps:
- Prerequisites: You need a rental agreement document, a BoldSign account (which has a free tier for testing) [00:44], a Google Sheet, and an n8n instance.
- BoldSign Setup: How to upload your agreement as a template, drag-and-drop the signature and text fields [01:13], get your API key [01:57], and set up a webhook to notify n8n when the agreement is signed or completed [02:13].
- Workflow Logic: The video walks through the two main flows:
- Form Submission: A tenant fills out a form, which triggers n8n to save the details to Google Sheets and then call the BoldSign API to send the agreement to both the owner and tenant [03:01].
- Completion: When both parties sign, BoldSign sends an event to the n8n webhook, which then filters for the âCompletedâ event and updates the Google Sheet [09:12].
- Bonus: It also covers the Telegram bot setup, which lets an owner ask an AI about the status of agreements [11:52].
Prerequisites
Before you build this, youâll need a few things:
- An n8n Instance: This can be on n8n.cloud or self-hosted.
- A Google Sheet: Create a new sheet with columns like
Tenant Name,Tenant Email,Property,Estimated Rent per month,contract expiry, andagreement status. - A BoldSign Account:
- A Telegram Bot (Optional): If you want the AI status checker, youâll need to create a bot with Telegramâs BotFather to get an API token.
- A Google Gemini API Key (Optional): For the AI agent.
In BoldSign, you would replace the {{...}} and [Date] parts with draggable form fields.
Understanding the BoldSign API Node
The key to sending the agreement is the Send aggrement to Tenant's Email node. This is a standard HTTP Request node, not a special BoldSign node.
Method:POSTURL:https://api.boldsign.com/v1/template/send?templateId=enter-your-template-id- This is the official BoldSign API endpoint for sending a document based on a template. You must replace
enter-your-template-idwith the actual ID of the template you created in BoldSign [07:04].
- This is the official BoldSign API endpoint for sending a document based on a template. You must replace
Authentication:Header Auth- BoldSign uses an API key in the header. You would create a credential in n8n where the
NameisX-API-KEYand theValueis the secret API key you got from your BoldSign account [07:16].
- BoldSign uses an API key in the header. You would create a credential in n8n where the
Body: ThejsonBodyis the most important part [08:02]. Itâs a JSON object that tells BoldSign who to send the agreement to and what data to pre-fill.title: Sets the document title, like âRental Agreement - 123 Main Stâ.roles: This array defines the signers.- One role is for the âOwnerâ, dynamically filling their name and email from the form data.
- The second role is for the âTenentâ (Tenant), also filling their name and email.
existingFormFields&mergeFields: This is where you dynamically insert data into the document. You map the data from your n8n form (like{{ $('Retrive Data from submitted form').item.json.address }}) to theidof the fields you created in your BoldSign template [08:16].
Workflow Explanation (From Scratch)
This workflow is actually three separate flows that work together.
Flow 1: New Tenant Onboarding (Form to Agreement)
This is the main flow that kicks everything off when a new tenant is interested.
-
Node:
Tenant Form(Form Trigger)- What it is: This node creates a public web form [03:10]. This is the starting point.
- From Scratch: Youâd drag in a
Form Triggernode. You add fields for âYour Nameâ (tenantâs name) and âYour Emailâ (tenantâs email). - This Workflow: It also cleverly uses hidden fields [03:18] to store the ownerâs details, the property address, and the rent. This is a simple way to manage a single property. For multiple properties, you might use a database or a Google Sheet lookup.
-
Node:
Retrive Data from submitted form(Set)- What it is: This node takes the messy data from the form and organizes it into clean, named variables (like
tenant_name,address,estimated_rent) [05:25]. - From Scratch: Itâs good practice to do this so the rest of your workflow is easy to read. It also calculates the
expiry_dateas one year from today.
- What it is: This node takes the messy data from the form and organizes it into clean, named variables (like
-
Node:
Save the tenant Details(Google Sheets)- What it is: This logs the new tenant in your Google Sheet before the agreement is sent [05:51].
- From Scratch: Youâd set this to âAppend or Updateâ mode. It maps the variables (
tenant_name,tenant_email, etc.) to the correct columns in your sheet.
-
Node:
Send aggrement to Tenant's Email(HTTP Request)- What it is: This is the BoldSign API call we just detailed. It takes all the data and sends the official signing request to both the ownerâs and tenantâs email addresses [06:47].
-
Node:
Update Agreement Status(Google Sheets)- What it is: After the email is successfully sent, this node finds the row you just created (using the tenantâs email as a key) and updates the
agreement statuscolumn to âPending Signingâ [08:55]. This is great for tracking.
- What it is: After the email is successfully sent, this node finds the row you just created (using the tenantâs email as a key) and updates the
Flow 2: Handling Signed Agreements (Webhook)
This flow listens for activity. It doesnât run on a schedule; it waits for BoldSign to tell it something happened.
-
Node:
Webhook(Webhook Trigger)- What it is: This node generates a unique URL [02:45]. You copy this URL and paste it into your BoldSign accountâs webhook settings [09:28].
- From Scratch: Now, any time an event happens in BoldSign (like the document is viewed, signed, or completed), BoldSign will send a data packet to this URL, triggering the workflow.
-
Node:
If(If)- What it is: This is a filter. The webhook gets all events, but we only care about the final one [10:49].
- From Scratch: Itâs set to check the incoming data from the webhook. It looks at a header called
x-boldsign-eventand only continues if the valueequalsâCompletedâ [11:02]. This means it will ignore the âSignedâ event (when just one person signs) and only proceed when both parties have signed.
-
Node:
Retrieve Tenant Email(Set)- What it is: This node digs into the large JSON data packet from the webhook to find the tenantâs email [11:17].
- From Scratch: It uses a JavaScript
.find()function to look through thesignerDetailsand pull the email for the person whose role was âTenentâ (Tenant). This gives us the unique key to update our spreadsheet.
-
Node:
Update Agreement Status as completed(Google Sheets)- What it is: The final step! Just like in Flow 1, this node finds the correct row in the Google Sheet (using the tenantâs email) and updates the
agreement statuscolumn to âCompletedâ [11:32].
- What it is: The final step! Just like in Flow 1, this node finds the correct row in the Google Sheet (using the tenantâs email) and updates the
Flow 3: AI-Powered Status Bot (Telegram)
This is a bonus flow that lets the owner âchatâ with the Google Sheet.
-
Node:
Telegram Trigger- What it is: This listens for any new message sent to your Telegram bot [11:52].
-
Node:
AI Agent(Langchain Agent)- What it is: This is the âbrainâ. It takes the
message.textfrom the Telegram user [12:30]. - From Scratch: Its prompt tells it to be a helpful assistant for rental agreements and to use the tools itâs given.
- What it is: This is the âbrainâ. It takes the
-
Node:
Google Gemini Chat Model(Google Gemini)- What it is: This is the Large Language Model (LLM) that the agent uses to think and form sentences.
-
Node:
Fetch Rental Agreements(Google Sheets Tool)- What it is: This is not a regular node, but a Tool plugged into the AI Agent [12:35].
- From Scratch: You give the AI agent this âtoolâ and tell it: âThis tool, named âFetch Rental Agreementsâ, can get all the data from the Google Sheet.â When the user asks, âWhatâs the status of Jane Doeâs agreement?â, the AI knows it must use this tool to get the sheet data before it can answer.
-
Node:
Send a text message(Telegram)- What it is: This takes the final
outputfrom the AI Agent and sends it as a reply to the user in Telegram.
- What it is: This takes the final
đ Nodes Used
Google Sheets, HTTP Request, Webhook, Telegram, Telegram Trigger, AI Agent
đ„ Import
Download workflow.json and import into n8n:
Workflow menu â Import from File