Workflows· Legal & Compliance

    The Contract Risk Chain

    An automation workflow that reads new contracts on arrival, extracts key terms, and files a structured high, medium and low risk assessment for the responsible team to review.

    automatingreviewinganalytical

    Description

    Steps

    Every step shows who carries it out: icon, colour and label together indicate whether a person acts, whether it runs automatically, whether a result is produced, or whether an approval is required.

    01Person

    A new contract file, PDF or DOCX, is placed in the "Contracts/New" folder and starts the process.

    02Automated

    03Automated

    04Automated

    05Automated

    06Result

    Key
    PersonAutomatedResultApproval

    Requirements and operations

    Requirements

    • Cloud storage Drive, Dropbox, OneDrive or comparable, with a "Contracts/New" folder and write access.
    • OCR tool Required for scanned contracts, otherwise extraction stays empty for scans.
    • Storage for the summaries Notion, Drive, or Confluence for the "Legal Reviews" database.
    • LLM access and notification Access to OpenAI, Claude, or Gemini plus Gmail or Slack for the legal team.

    Testing

    • Test contract Place an anonymized sample in the "Contracts/New" folder.
    • Check extraction Are the contract text and key terms cleanly structured, including for scans?
    • Risk and priority Is the categorization traceable and are the recommendations concrete?
    • Edge cases Test different contract types, poor scans, and very long contracts.

    Go-live

    • Approval to start Activate the workflow only once extraction, risk analysis, and notification are reliably correct.
    • Start with one type Begin with one contract type, for example NDAs, and add templates for further types step by step.
    • Define escalation Set clear rules for contracts rated high risk.
    • Expand Later extend with type categorization, deadline tracking, and a compliance check.

    Common issues

    • PDF not searchable Enable OCR, otherwise extraction stays empty for scans.
    • Extraction too generic Adapt the prompt per contract type.
    • Notification does not arrive Check addresses, channels, and permissions.
    • Duplicates on upload Use a file hash or contract number as a dedup key.

    Builder Prompt

    GOAL
    Build a workflow that starts automatically for every new contract in the monitored folder: text recognition including OCR, structured extraction of the key terms, a risk analysis sorted into high, medium, and low, filing the summary in the "Legal Reviews" database, and notifying the legal team with a link and priority.
    
    Adapt the structure to the concepts of your automation tool (for example nodes, steps, zaps, or agent actions). While doing so, preserve the trigger logic, the sequence, and the data flow.
    
    TRIGGER
    Type: new file (PDF or DOCX) in the "Contracts/New" folder in your cloud storage.
    
    STEPS
    1. Duplicate check: check a file hash or contract number as a dedup key, skip contracts already processed.
    2. Extract text: read out the contract text, run OCR first for scanned PDFs without exception.
    3. AI step: key terms extraction. Use exactly the Key Terms Extraction working prompt (see the Working Prompts section). Output: structured contract elements.
    4. AI step: risk analysis. Use exactly the Risk Analysis working prompt (see the Working Prompts section) with the key terms from step 3 as input. Output: executive summary, risks sorted into high, medium, and low, recommendations for action, and review priority.
    5. Store: file the summary in structured form in the "Legal Reviews" database, with a link to the original document and the review priority as its own field.
    6. Notify: inform the legal team by email or chat, with a link to the review and the priority. For priority high, apply the defined escalation rule, for example a direct message instead of a shared channel.
    
    PROMPTS
    Take over both working prompts from the section of the same name unchanged. Do not alter the placeholders they contain, and map them as described in the data flow.
    
    DATA FLOW
    Step 2 to step 3: extracted contract text as [CONTRACT_TEXT].
    Step 3 to step 4: structured key terms as [KEY_TERMS].
    Step 4 to steps 5 and 6: executive summary, risks, recommendations for action, and review priority.
    Trigger to step 5: link to the original document.
    
    ERROR HANDLING
    PDF not searchable or OCR returns empty text: stop processing and send an error notice to the legal team instead of analyzing empty text.
    Very long contract, token limit reached: extract section by section and then merge the key terms.
    Duplicate detected: skip and log it.
    Notification fails: check addresses, channels, and permissions, and log the error.
    Principle: the analysis stays groundwork and does not replace a legal review. Every review goes to the legal team.
    
    PLACEHOLDER CONVENTION
    [CONTRACT_TEXT] and [KEY_TERMS] are mapped fully dynamically, as described in the data flow. There are no placeholders that require manual configuration in the prompts themselves. Only the monitored folder, the OCR tool, the target database, the recipients, and the escalation rule are configured manually.
    
    SELF CHECK BEFORE COMPLETION
    Check, before you report the workflow as finished:
    1. Are all steps connected correctly, including the duplicate check before the actual processing?
    2. Are both working prompts inserted in full and unchanged, and are [CONTRACT_TEXT] and [KEY_TERMS] mapped correctly?
    3. Is the OCR handling for scans active, and is the review priority carried through into the database and the notification?
    4. Are all points listed that require manual configuration: the "Contracts/New" folder, the OCR tool, the target database, the recipients, the escalation rule, and the LLM access?

    Working prompts

    Key Terms Extraction

    Pulls the key contract elements from the contract text into a fixed format.

    You are a legally knowledgeable assistant. Analyze the following contract and extract the key contract elements in structured form.
    
    CONTRACT:
    [CONTRACT_TEXT]
    
    Extract the following information:
    
    1. CONTRACTING PARTIES
       - Client:
       - Contractor:
    
    2. CONTRACT TERM
       - Start date:
       - End date:
       - Automatic renewal: (Yes/No plus conditions)
    
    3. TERMINATION PERIODS
       - Ordinary termination:
       - Extraordinary termination:
    
    4. COSTS AND PAYMENT TERMS
       - Total volume:
       - Payment frequency:
       - Payment due date:
       - Price adjustment clauses:
    
    5. LIABILITY AND WARRANTY
       - Liability limitations:
       - Warranty periods:
       - Insurance:
    
    6. OTHER IMPORTANT CLAUSES
       - Confidentiality:
       - Data protection:
       - Jurisdiction:
       - Other:
    
    State "Not specified" when information is missing or unclearly worded in the contract, instead of speculating.

    Risk Analysis

    Assesses the extracted key terms and produces an executive summary, risk rating, and review priority.

    You are an experienced lawyer. Based on the following extracted contract data, create a risk analysis and an executive summary.
    
    EXTRACTED CONTRACT DATA:
    [KEY_TERMS]
    
    TASKS:
    
    1. EXECUTIVE SUMMARY (3 to 5 sentences)
    Summarize the key points of the contract: who, what, when, how much.
    
    2. RISK ANALYSIS
    Identify possible legal risks in the following categories:
    
       HIGH RISKS (immediate action required):
       - [Critical points, for example missing liability limitation, unrealistic termination periods]
    
       MEDIUM RISKS (should be reviewed):
       - [Moderate risks, for example unclear wording, missing clauses]
    
       LOW RISKS (for information):
       - [Minor points of note]
    
    3. RECOMMENDATIONS FOR ACTION
       - [Concrete next steps for the legal team]
    
    4. REVIEW PRIORITY
       Assess the urgency: HIGH / MEDIUM / LOW
       Rationale: [1 to 2 sentences]
    
    Stay precise, factual, and practice oriented. At the end, point out that this assessment does not replace legal advice and that results with legal implications should be reviewed by a lawyer.

    JSON export

    Setup

    Two routes lead to the same result. Pick the one that fits your setup.

    Suitable when you want to build the workflow in your own automation tool.

    1. Open your workflow tool, for example n8n, Make, Zapier or Langdock.
    2. Create a new workflow and give it a name.
    3. Choose the AI-assisted build option if your tool offers one.
    4. Paste the builder prompt from above in full.
    5. Check the result against the step sequence in this document, then add your access credentials and channels.

    Suitable when you want to take the workflow over unchanged.

    1. Download the JSON file from the JSON export section.
    2. Open the workflow area of your tool and create a new workflow.
    3. Give it a name and confirm.
    4. Open the menu on the workflow name and choose to import a JSON file.
    5. Upload the file, then add your own access credentials.
    6. Run a test before you activate the workflow.

    Last reviewed:

    In the workshop this becomes your method.

    A single prompt becomes a repeatable method. We show that in the workshop From Prompt to Method.

    View workshops

    Related resources

    Browse all resources

    Conversation, not pitch

    Understand first, then decide. We take time for an initial conversation, without sales pressure, without obligation.

    Schedule a call