Skip to content

Use case

Contract Review and Renewal Tracking ​

Read contracts from a Document Store bucket, extract renewal terms, remember them, and tell people before a contract renews instead of after.

  • Stack Cognipeer Flows + Document Store
  • Pattern Flow · Back office
  • Read ~5 min

Overview ​

Contracts sit in a folder nobody opens until something auto-renews. This build keeps them in a Document Store bucket. One flow reads a contract and extracts its terms; another reports what renews soon.

Enterprise module

Flows is the enterprise flows module. See Flows.

The shape of the flows ​

Review flow:   Start (fileId) -> Read file (Markdown copy) -> Extract data
               -> Remember value (key: contract:<fileId>) -> End

Digest flow:   Start -> List remembered values (prefix: contract:)
               -> LLM (list what renews in the next 60 days) -> Send email -> End

Build it ​

  1. Store the contracts in a bucket (see Files). Turn on the Markdown copies so a PDF or Office file can be read as text.
  2. Review flow. On Start declare fileId. Read file by File id with Return as Markdown copy (PDF, Office, ...).
  3. Extract the terms. Extract data takes the text and the Fields to extract: counterparty, start_date, renewal_date, notice_days, auto_renews, termination_clause. A field the text does not state comes back as null, and the step reports missing and complete, so you can route incomplete contracts to a person. Add Extra instructions such as the date format.
  4. Remember. Remember value with the key contract: followed by the file id and the extracted object as the value. Set Shared with to All flows in the project so the digest flow can read it. Expire after can stay empty.
  5. Digest flow. List remembered values with Key prefix contract:, then an LLM step that picks the contracts whose renewal falls within the notice window and writes a short list. Send email to the owner.
  6. Schedule the digest. Flows start from the editor, the API, an agent tool or another flow. To run it weekly, expose it as a tool on an agent and add a schedule trigger whose prompt asks the agent to run the digest, or call the Flows API from your own scheduler.

Pitfalls ​

  • Extraction is a draft. Dates and notice periods drive money decisions. Keep a Human approval step before anything is acted on, and keep the source file linked in the output.
  • One key per contract. Re-reviewing a contract overwrites its record, which is what you want.
  • Do not paste contract text into prompts you cannot trace. Run detail shows each step's input; give the flow's readers only the access they need (Flows permissions).