# Contract intake and routing n8n template

> An importable n8n workflow with two front doors: a contracts@ Gmail inbox that reads attached PDFs, and a webhook for a Slack slash command, Jotform or JSON. Claude classifies the agreement type and paper and extracts counterparty, value, term, renewals, personal data and missing fields with follow-up questions. A Google Sheet routing table assigns a reviewer and turnaround target, and a Jira ticket is created. You need n8n, Gmail, an Anthropic API key, Google Sheets, Jira Cloud and Slack.

- Platform: n8n
- Download: https://www.lumeor.studio/templates/n8n/automate-contract-intake-and-routing.json
- Trigger: New email to contracts@, or a Slack slash command or form webhook
- Credentials needed: Gmail OAuth2, Anthropic API, Google Sheets OAuth2, Jira Software Cloud, Slack
- Full guide: https://www.lumeor.studio/guides/automate-contract-intake-and-routing/
- Last updated: 2026-10-14

## What this workflow does

1. **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.
2. **Slack or form intake** (Webhook) accepts a `/contract` slash command, a Jotform submission or plain JSON, and answers Slack within its time limit.
3. **Normalize email request** and **Normalize form request** (Code) turn every channel into the same shape: requester, request text, document name and text.
4. **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.
5. **Parse extraction** (Code) and **Extraction OK?** (If) handle refusals, truncated output and missing text.
6. **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.
7. **Routed?** (If) catches requests no rule matches.
8. **Create Jira ticket** assigns the reviewer with the extracted terms, turnaround target and requester questions, and **Notify legal in Slack** posts the ticket key.
9. **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 `/contract` command, 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-5` is cheaper for high-volume, simple classification, but full contracts benefit from the larger model.

## Setup

1. Import the JSON and connect Gmail, Anthropic, Google Sheets, Jira and Slack credentials.
2. Replace `REPLACE_WITH_CONTRACTS_ADDRESS` in the trigger's search filter.
3. Build the Routing tab with the columns in the sticky note, ending with a catch-all rule, and replace `REPLACE_WITH_SHEET_ID`.
4. Replace `REPLACE_WITH_JIRA_PROJECT_ID` and `REPLACE_WITH_JIRA_ISSUE_TYPE_ID` with IDs from your Jira project.
5. Replace `REPLACE_WITH_SLACK_LEGAL_CHANNEL_ID` and `REPLACE_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](/guides/automate-contract-intake-and-routing/) for routing matrix design, or [talk to Lumeor](/start/) about SharePoint filing and signature tracking.

---

Source: https://www.lumeor.studio/templates/automate-contract-intake-and-routing/
Published by Lumeor Studio, Newtown, PA. hello@lumeor.studio. Get a written scope: https://www.lumeor.studio/start/
