See llms.txt for all machine-readable content.

Back to Templates

Review construction claims using schedule variance, Gemini, Wikipedia and Telegram

Quick overview

This workflow collects a construction claim via an n8n form, validates an uploaded PDF and schedule CSV, computes schedule variances for a specific activity, retrieves reference passages (plus a Wikipedia glossary), and uses Google Gemini to generate a structured JSON assessment for download (optionally also sent to Telegram).

How it works

  1. Receives a claim submission through an n8n Form Trigger with project details, a claim PDF, an activity ID, and a schedule CSV.
  2. Validates the form fields and file uploads, then parses the schedule CSV for the given activity ID and calculates baseline-to-actual start and finish variance in calendar days.
  3. Extracts selectable text from the uploaded PDF and prepares a structured evidence payload and JSON response schema for Google Gemini.
  4. Builds a small reference library (including a case-law entry and guidance passages), fetches a German terminology glossary from Wikipedia, and selects the most relevant passages to attach as context.
  5. Calls Google Gemini three times to produce specialist findings (contract/notice review, delay/causality analysis, and evidence review), then combines them into a single synthesis request.
  6. Calls Google Gemini again to generate the final structured assessment, validates the returned JSON and any bracketed source IDs against the retrieved sources, and flags failures for manual review.
  7. Packages the result as a downloadable JSON file via the form completion page and optionally sends the JSON document to a fixed Telegram chat.

Setup

  1. Add Google Gemini (PaLM) API credentials (googlePalmApi) for the four HTTP Request steps that call the Gemini generateContent endpoint.
  2. Prepare inputs that match the workflow’s expectations: a text-based PDF up to 10 MiB, a UTF-8 schedule CSV up to 1 MiB with headers activity_id, baseline_start, baseline_finish, actual_start, actual_finish, and ISO dates (YYYY-MM-DD).
  3. Update or replace the entries in the built-in reference library (especially any test/example passages) with approved project excerpts or verified legal references as needed.
  4. (Optional) Add a Telegram bot credential and set the target chat ID and delivery toggle so successful JSON reports can be sent as a Telegram document.