Auto-archive signed Docusign contracts to Google Drive

By General Input

Every time a Docusign envelope is completed, file the signed PDF in Google Drive by counterparty and log a row in a Google Sheet.

Integrations

  • Docusign
  • Google Drive
  • Google Sheets

Type

Deterministic Code

Categories

  • Operations
  • Finance

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.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads