Quick Overview
This workflow listens for emergency equipment breakdown requests via Telegram, emails multiple rental vendors through Gmail to request quotes, uses Azure OpenAI to compare responses, and sends the project manager an approval email with Approve/Reject links before notifying the vendor and foreman.
How it works
- Triggers when a foreman sends a /breakdown command to a Telegram bot.
- Parses and normalizes the request details (machine type, site, duration, urgency) and generates a unique breakdown reference.
- Sends a quote-request email to each vendor via Gmail and waits for the vendor reply window to close.
- Aggregates collected vendor quotes, filters out unavailable options, and sends the shortlist to Azure OpenAI to produce a ranked recommendation and HTML comparison table.
- Emails the project manager via Gmail with the comparison and one-click approval and rejection links, then waits for the response.
- If approved, emails a booking confirmation to the recommended vendor and sends a Telegram confirmation message to the foreman; if rejected, emails the project manager a manual-review notice.
- If the workflow errors at any point, posts an error alert to a designated Slack channel.
Setup
- Add Telegram Bot credentials for the Telegram trigger and ensure the /breakdown command is configured for your bot.
- Add Gmail OAuth2 credentials and update all Gmail nodes with the correct sender account and real recipient addresses (vendors and project manager).
- Add Azure OpenAI credentials (endpoint, deployment/model, and API key) for the quote analysis step.
- Replace the placeholder vendor names and email addresses in the vendor list with your actual suppliers and ensure vendor replies are captured and mapped into the workflow’s quote aggregation.
- Replace the placeholder approval webhook base URL (YOUR-N8N-INSTANCE) with your live n8n domain so the Approve/Reject links route back to your instance.
- Add Slack OAuth2 credentials and set the target channel for workflow error notifications.