Quick Overview
This workflow ingests construction incident webhooks, normalizes the payload, and uses OpenAI GPT-4o-mini to classify each incident by type and urgency, then routes alerts to Slack and Gmail and logs incidents to Google Sheets, with a daily Slack digest generated from the sheet.
How it works
- Receives an incoming incident via a POST webhook.
- Normalizes the incoming Procore/Fieldwire-style payload into a consistent incident object (ID, title, description, location, reporter, assignee, and timestamps).
- Sends the incident details to OpenAI (GPT-4o-mini) to classify issue type and urgency and generate a short summary, recommended action, and tags.
- Routes incidents by urgency, sending Critical incidents to Slack with an @channel mention and emailing details to a project manager via Gmail.
- Sends High-urgency incidents to Slack as a formatted notice.
- Appends every incident to a Google Sheets log with status set to open.
- Runs daily at 18:00 server time, reads the incident log from Google Sheets, builds an urgency-grouped digest, and posts it to a Slack channel.
Setup
- Add credentials for OpenAI, Slack (OAuth2), Gmail (OAuth2), and Google Sheets (OAuth2).
- Copy the webhook URL from the Webhook trigger and register it in your source system (for example, Procore or Fieldwire) as the incident-created endpoint.
- Replace the placeholder Slack channel IDs for Critical, High, Digest, and Error alerts.
- Update the Gmail recipient address ([email protected]) to your real project manager email.
- Set the Google Sheets spreadsheet (document ID) and ensure the target sheet exists with columns that match the incident log fields used by the workflow.
- Confirm the schedule trigger time (cron: 0 18 * * *) matches your desired timezone/server time for the daily digest.