Auto-archive signed Docusign contracts to Google Drive
Every time a Docusign envelope is completed, file the signed PDF in Google Drive by counterparty and log a row in a Google Sheet.
Build a code workflow that automatically archives every completed Docusign envelope into Google Drive and logs it in a Google Sheet, so our contracts repository stays organized without any manual work.
Trigger: Docusign poll on envelope_status_changed. Filter so the workflow only continues when the envelope's status is 'completed'. Ignore sent, declined, voided, and any other status.
Step 1: Call Docusign Get Envelope using the envelope ID from the trigger to fetch the envelope subject, sent date, and completed date.
Step 2: Call Docusign List Recipients for the same envelope to extract the counterparty company name and the signer email addresses. Use the first signer recipient's company field as the counterparty name, falling back to the recipient name if no company is set.
Step 3: Call Docusign List Envelope Documents to find the combined signed PDF (the document with type 'content' or the 'combined' document), then call Docusign Download Document to pull the binary PDF bytes.
Step 4: In Google Drive, ensure a subfolder for the counterparty exists under a configurable root folder named 'Signed Contracts'. Look up the parent folder by name, then look up a child folder matching the counterparty. If it does not exist, call Google Drive Create Folder to create it as a child of the root.
Step 5: Upload the signed PDF into that counterparty subfolder. Use Google Drive Upload File (Multipart) for files up to 5MB, and Google Drive Upload File (Resumable) for files larger than 5MB. Name the file '{envelope subject} - {completed date}.pdf', using YYYY-MM-DD for the date. Capture the resulting Drive file's webViewLink.
Step 6: Call Google Sheets Append Values on a configurable spreadsheet and tab to add one row containing: envelope ID, envelope subject, counterparty company, signer emails (comma separated), sent date, completed date, and the Drive file URL.
Configurable inputs: the Drive root folder name (default 'Signed Contracts'), the Drive parent folder ID or shared drive ID, the target Google Sheet ID, and the target sheet/tab name. Every step is deterministic and there are no judgement calls or LLM nodes required.
Additional information
What does this prompt do?
- Watches Docusign for envelopes that just reached the completed state, with no manual download step.
- Pulls the combined signed PDF and files it in a Google Drive subfolder named after the counterparty company.
- Names every file consistently using the envelope subject and completion date so contracts are easy to find later.
- Appends a row to a Google Sheet with the envelope, counterparty, signer emails, sent date, completed date, and a link to the saved file.
What do I need to use this?
- A Docusign account with permission to read envelopes and download documents.
- A Google account connected to the Drive folder where signed contracts should live.
- A Google Sheet you want to use as the contracts log, with headers in the first row.
- The name of the parent Drive folder you want to archive into, for example Signed Contracts.
How can I customize it?
- Change the parent Drive folder, or switch to a shared drive so the whole team can browse archived contracts.
- Adjust the file name pattern, for example to lead with the completion date or include the envelope ID.
- Add or remove columns in the log sheet, like contract value, owner, or renewal date, and the workflow will fill them in.
- Filter to only archive specific envelope types by matching on the envelope subject or a Docusign custom field.
Frequently asked questions
What happens if the same counterparty signs multiple contracts?
Will this work for very large signed PDFs?
Does this re-archive contracts that were already completed before I turned it on?
Can I send the team a notification when a new contract is filed?
What if a Docusign envelope is voided or declined instead of completed?
Stop dragging signed contracts into Drive by hand.
Connect Docusign, Google Drive, and Google Sheets once, and Geni files every completed contract for you the moment it is signed.