What this workflow does
- NDA request form (Webhook) receives the form fields: requester, counterparty company, contact, purpose, mutual or one-way, whether they want to use their own paper, and free-text notes.
- Validate request and build prompt (Code) checks the required fields, picks the template for the NDA type and builds a Messages API request with a strict JSON schema.
- Claude: extract NDA fields (HTTP Request) calls the Anthropic Messages API with structured outputs. It returns the legal entity name, signer, country, requested governing law and term, a one-sentence purpose and any requested changes. It returns null rather than guessing.
- Apply review rules (Code) parses the response, handles
refusalandmax_tokensstop reasons, and applies your rules: approved governing law list, maximum term, US entities only, no counterparty paper, no requested edits, no missing legal name. - Standard request? (If) splits standard requests from ones that need a lawyer.
- Copy NDA template (Google Drive) copies the approved mutual or one-way template into a drafts folder.
- Fill template fields (Google Docs) replaces the bracketed tags with the extracted values. The legal text is never sent to or written by the model.
- Slack: draft ready posts the doc link to the requesters’ channel. Slack: legal review needed gets every non-standard request, and any failed API call, with the reasons listed.
Before you import
- n8n 1.x, cloud or self-hosted.
- An Anthropic API key, added as n8n’s built-in Anthropic credential.
- Google Drive and Google Docs OAuth2 credentials with access to your template folder.
- A Slack app with
chat:write, invited to both channels. - Counsel-approved mutual and one-way NDA templates in Google Docs.
Setup
- Import the JSON file into n8n and open each node with a warning icon to attach credentials.
- In Validate request and build prompt, replace
REPLACE_WITH_MUTUAL_TEMPLATE_DOC_IDandREPLACE_WITH_ONE_WAY_TEMPLATE_DOC_ID. In Apply review rules, editALLOWED_GOVERNING_LAW,DEFAULT_TERM_YEARSandMAX_TERM_YEARSto match what counsel approved. - Add these tags to your templates:
[[COUNTERPARTY_LEGAL_NAME]],[[COUNTERPARTY_SIGNER_NAME]],[[COUNTERPARTY_SIGNER_TITLE]],[[EFFECTIVE_DATE]],[[PURPOSE]],[[TERM_YEARS]],[[GOVERNING_LAW]]. - On Copy NDA template, replace
REPLACE_WITH_NDA_DRAFTS_FOLDER_ID. - Set
REPLACE_WITH_SLACK_CHANNEL_ID_FOR_REQUESTERSandREPLACE_WITH_SLACK_CHANNEL_ID_FOR_LEGAL. - Point your form’s submit action at the production webhook URL.
Test it
Send a test POST with a clean US request and confirm a filled draft appears in the folder. Then send one that names a German parent company and a five-year term. It should land in the legal channel with both reasons. Check the draft for any tag that was not replaced.
Make it production-ready
- Set an error workflow in the workflow settings so a failed Google or Slack call alerts someone.
- Add a CRM lookup before generation so the stored legal entity name wins over the extracted one, and check for an NDA already on file.
- Keep a log row per request (requester, route, reasons, doc ID) in a sheet or database for audit.
- The Claude node tries up to three times, five seconds apart. Watch Google Docs API quotas if requests arrive in bursts.
- Have legal review the first few weeks of standard drafts before you add the e-signature step.
claude-haiku-5-5is a cheaper option once volume grows.
Read the full guide at How to automate NDA generation, or talk to us if you want help wiring in e-signature and your CRM.