AI & RAG
Index new contract versions into a citation-ready clause store
When a contract lands or changes in Google Drive, it splits the document into clauses, embeds each one with version and section metadata.
How it runs
The automated pipeline, trigger to output.
- TriggerContract added or updated in Drive folderGoogle Drive
- ActionFetch and parse document textGoogle Drive
- LogicSkip if checksum unchanged (no new version)
- ActionSplit into clauses with section paths
- ActionEmbed each clause with version metadataOpenAI
- OutputUpsert clauses + vectors into Supabase storeSupabase
What it does
Keeps a versioned, citation-grounded clause index in sync with your legal document library. Every time a contract is added or revised in Google Drive, this workflow turns it into individually addressable clauses — each tagged with the source file, version, effective date, and section path — and writes them to a Supabase pgvector table that downstream answer flows query.
When to use it
Run this as the foundation under any contract Q&A or clause-lookup workflow. It is the ingestion side: you want retrieval to know *which* version of an MSA a clause came from, not just that the text exists somewhere. Ideal when legal owns a Drive folder of evolving agreements and templates.
How it works
- 1A Google Drive change on the watched contracts folder fires the trigger.
- 2The file content is pulled and parsed, and a logic step skips anything that is not a new or updated version (by checksum).
- 3The document is segmented into clauses with section headings preserved as a path.
- 4OpenAI embeds each clause along with its metadata.
- 5The clauses and vectors are upserted into Supabase, superseding the prior version's rows while retaining version history for citations.
Set it up
What you configure once, before turning it on.
- 1Connect Google DriveDocs, sheets, slides, files.
- 2Connect OpenAIModels, embeddings, files.
- 3Connect SupabaseTables, auth, storage, edge functions.
- 4Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
- 5Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
- 6Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.
More AI & RAG workflows
Publish a Grounded API FAQ Page to Confluence Weekly
Each week, clusters the top unanswered or repeated API questions, generates spec-grounded answers with citations.
Detect Breaking API Changes from Spec Diffs and Alert Owners
Compares the new OpenAPI spec against the previous version on each GitLab merge, uses retrieval over the changelog to classify whether changes are breaking.
Pre-meeting prep brief grounded in Coda and CRM
Before each booked sales meeting, builds a one-page prep brief by combining the account's HubSpot context with grounded talking points and objection responses pulled from your…
Coda-grounded sales answer bot with citations in Slack
Reps ask product, pricing, or competitive questions in Slack and get an answer drawn only from your Coda knowledge hub, with links to the exact docs and rows it pulled from.
Weekly knowledge-gap digest from unanswered rep questions
Each week, scans rep questions the answer bot couldn't ground in Coda, clusters the recurring gaps.
RFP and security questionnaire drafter grounded in Coda
Drafts answers to inbound RFP and security questionnaire questions by retrieving approved language from your Coda hub, then files the cited draft for review before a rep sends it.
Run it inside a business
This workflow drops into a full company template. Import the org, and this is one of the playbooks its agents run.

Run this workflow in your colony.
14-day trial. No DevOps. No Sales call. Provisioned in under a minute.
