Autonomous Jobsite Daily Delay Triage Agent Script
Generate an autonomous agent script to ingest subcontractor field logs, classify schedule delays, and trigger superintendent escalation workflows.
Use this template when deploying an autonomous AI worker on active construction sites to parse raw trade logs against schedule baselines. It produces an executable Python agent workflow that detects bottlenecks and routes corrective notifications.
Role: Principal Construction Technology Architect specializing in site automation and multi-agent workflow systems.
Context
- Active jobsite name: {{site_name}}
- General contractor organization: {{general_contractor}}
- Schedule baseline source: {{schedule_baseline_tool}}
- Delay variance escalation threshold: {{delay_threshold_hours}}
- Target alerting endpoint: {{notification_webhook}}
- Monitored subcontractor trades: {{subcontractor_trades}}
Task
Author a production-grade, executable Python script defining an autonomous agent workflow that ingests daily field reports, correlates trade progress against {{schedule_baseline_tool}}, isolates critical path delays exceeding {{delay_threshold_hours}}, and triggers structured payload alerts to {{notification_webhook}}.
Method
- Define environment configuration, schema definitions, and client initializations for LLM tool calling and log ingestion.
- Ingest raw subcontractor daily reports across {{subcontractor_trades}} at {{site_name}}.
- Query the schedule baseline in {{schedule_baseline_tool}} to extract current milestones, dependencies, and float values.
- Execute an LLM reasoning node to parse unstructured trade notes, extracting reported crew sizes, equipment downtime, and work completed.
- Compare extracted work velocity against baseline milestones to compute schedule variance in hours.
- Evaluate if variance exceeds {{delay_threshold_hours}} on active critical path activities.
- Construct a standardized JSON payload detailing root cause, trade impact, and suggested mitigation steps for {{general_contractor}}.
- Dispatch an asynchronous HTTP POST request to {{notification_webhook}} and log audit telemetry.
Constraints
- MUST produce fully runnable, modular Python code using modern type hints and error handling.
- MUST NOT hardcode API credentials; consume environment variables instead.
- Logic MUST explicitly separate critical path impacts from non-critical float consumption.
- Include inline documentation explaining fallback error states for corrupted daily logs.
Output format
- Code Header and Imports block
- Data Schema and Typed Models (Pydantic)
- Core Agent State Machine / Tool Execution functions
- Orchestration Runner and Webhook Dispatcher
- Deployment and Environment Variable Execution Guide
Self-review
- Verify that all six variables ({{site_name}}, {{general_contractor}}, {{schedule_baseline_tool}}, {{delay_threshold_hours}}, {{notification_webhook}}, {{subcontractor_trades}}) are actively utilized.
- Ensure script logic contains clear exception handling for failed schedule tool queries.
- Check that output strictly adheres to runnable script requirements without pseudo-code placeholders.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.