What this workflow does
- contracts@ inbox (Gmail Trigger) picks up new requests with attachments downloaded, and Extract PDF text reads the first PDF. Emails without a readable PDF continue with the email text only.
- Slack or form intake (Webhook) accepts a
/contractslash command, a Jotform submission or plain JSON, and answers Slack within its time limit. - Normalize email request and Normalize form request (Code) turn every channel into the same shape: requester, request text, document name and text.
- Classify and extract with Claude (HTTP Request) returns agreement type, whose paper it is, counterparty, value, term, auto-renewal, personal data, business unit, deadline, a summary, missing fields and specific follow-up questions, all from a strict JSON schema.
- Parse extraction (Code) and Extraction OK? (If) handle refusals, truncated output and missing text.
- Read routing table (Google Sheets) loads legal’s rules once per run, and Apply routing matrix (Code) evaluates them in priority order by type, paper, value range, personal data and business unit, adding a privacy review when personal data is involved.
- Routed? (If) catches requests no rule matches.
- Create Jira ticket assigns the reviewer with the extracted terms, turnaround target and requester questions, and Notify legal in Slack posts the ticket key.
- Post exception to Slack collects empty requests, model problems, unmatched rules and Jira errors.
Before you import
- A Gmail mailbox or alias for contracts@ connected through OAuth.
- A Slack app with a
/contractcommand, or a Jotform form, pointing at the webhook. - Jira Cloud with a legal project, and reviewers’ Jira account IDs for assignment.
- An Anthropic API key. The template uses
claude-opus-5-5;claude-haiku-5-5is cheaper for high-volume, simple classification, but full contracts benefit from the larger model.
Setup
- Import the JSON and connect Gmail, Anthropic, Google Sheets, Jira and Slack credentials.
- Replace
REPLACE_WITH_CONTRACTS_ADDRESSin the trigger’s search filter. - Build the Routing tab with the columns in the sticky note, ending with a catch-all rule, and replace
REPLACE_WITH_SHEET_ID. - Replace
REPLACE_WITH_JIRA_PROJECT_IDandREPLACE_WITH_JIRA_ISSUE_TYPE_IDwith IDs from your Jira project. - Replace
REPLACE_WITH_SLACK_LEGAL_CHANNEL_IDandREPLACE_WITH_SLACK_EXCEPTIONS_CHANNEL_ID.
Test it
Collect 20 past requests: NDAs on your paper, vendor agreements on theirs, a large sales MSA and a DPA. Send a few to contracts@ with their PDFs and a few through /contract. Compare the ticket’s type, paper and value with what a lawyer would say, and check that the DPA triggers the privacy note. Then send “can legal look at this?” with no document and confirm the ticket lists specific follow-up questions.
Make it production-ready
- Measure type accuracy and field accuracy separately on 50 past requests before going live.
- Send the follow-up questions to the requester automatically and pause the ticket until they answer.
- Look up the counterparty in Salesforce or HubSpot and attach the related record.
- Convert Word attachments to PDF or text before extraction, and keep large documents within the model’s limits.
- Add DocuSign envelopes for approved final versions and file executed copies with metadata, as the guide describes. Add an n8n error workflow.
Read the full guide on automating contract intake and routing for routing matrix design, or talk to Lumeor about SharePoint filing and signature tracking.