Control de estado web
Verifica automáticamente el estado de sitios web, detecta errores comunes y envía notificaciones para mantener la disponibilidad y funcionamiento del servicio.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
GSheetCellComponent-bbcvr[Sheet Cells ]
style GSheetCellComponent-bbcvr stroke:#a170ff
CreateData-5zr0k[Create Data]
style CreateData-5zr0k stroke:#a170ff
Switch-n1nr4[Switch]
style Switch-n1nr4 stroke:#a170ff
GmailMesageComponent-enpm4[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Gmail Message2]
style GmailMesageComponent-enpm4 stroke:#a170ff
GmailMesageComponent-hzzfk[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Gmail Message2]
style GmailMesageComponent-hzzfk stroke:#a170ff
GmailMesageComponent-l0ex2[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Gmail Message2]
style GmailMesageComponent-l0ex2 stroke:#a170ff
APIRequest-fg3or[API Request2]
style APIRequest-fg3or stroke:#a170ff
Prompt-6idci[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>título3xx]
style Prompt-6idci stroke:#a170ff
Prompt-3w0jh[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>cuerpo2]
style Prompt-3w0jh stroke:#a170ff
Prompt-dmgnv[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>título4xx]
style Prompt-dmgnv stroke:#a170ff
Prompt-8br5u[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>cuerpo4xx]
style Prompt-8br5u stroke:#a170ff
Prompt-8utdo[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>título5xx]
style Prompt-8utdo stroke:#a170ff
Prompt-s80c7[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>cuerpo5xx]
style Prompt-s80c7 stroke:#a170ff
CreateData-5zr0k -.- Switch-n1nr4
linkStyle 0 stroke:#a170ff
GSheetCellComponent-bbcvr -.- APIRequest-fg3or
linkStyle 1 stroke:#a170ff
APIRequest-fg3or -.- CreateData-5zr0k
linkStyle 2 stroke:#a170ff
Prompt-6idci -.- Prompt-3w0jh
linkStyle 3 stroke:#a170ff
Prompt-3w0jh -.- GmailMesageComponent-enpm4
linkStyle 4 stroke:#a170ff
Switch-n1nr4 -.- Prompt-6idci
linkStyle 5 stroke:#a170ff
Switch-n1nr4 -.- Prompt-dmgnv
linkStyle 6 stroke:#a170ff
Switch-n1nr4 -.- Prompt-8utdo
linkStyle 7 stroke:#a170ff
Prompt-dmgnv -.- Prompt-8br5u
linkStyle 8 stroke:#a170ff
Prompt-8utdo -.- Prompt-s80c7
linkStyle 9 stroke:#a170ff
Prompt-8br5u -.- GmailMesageComponent-hzzfk
linkStyle 10 stroke:#a170ff
Prompt-s80c7 -.- GmailMesageComponent-l0ex2
linkStyle 11 stroke:#a170ff
Control de estado web
🧩 Overview
This workflow automates the monitoring of website health by checking their HTTP status codes. It reads a list of website names and URLs from a Google Sheets document, performs HTTP requests to each site, and categorizes the responses. Based on the status code (e.g., 3xx, 4xx, 5xx), it automatically generates and sends tailored email notifications via Gmail to alert about potential issues like redirections, client errors, or server failures.
⚙️ Main Features
- Fetches website data in batch from a Google Sheets spreadsheet.
- Performs parallel HTTP requests to check the status of multiple websites efficiently.
- Dynamically creates data records containing the website name and its HTTP status code.
- Routes data to different processing branches based on the status code category using a conditional switch.
- Generates context-specific email subjects and bodies for different error types.
- Sends notification emails via Gmail for websites with problematic status codes.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Sheet Cells | Fetches the initial list of websites to monitor from a Google Sheets document. | Google Sheets range containing website names and URLs. | Batch data of website names and URLs. |
| API Request | Performs an HTTP GET request to each website URL to retrieve its status code. | List of website URLs. | HTTP response data, including the status code for each site. |
| Create Data | Constructs a unified data record for each website, combining its name and the retrieved HTTP status code. | Website name from the sheet and status code from the API request. | Structured data record with nombre_del_sitio and status fields. |
| Switch | Evaluates the status field and routes each data record to a specific output branch based on the first digit of the status code (e.g., 3xx, 4xx, 5xx). |
Data record containing the website name and status code. | Routed data to one of several conditional output paths. |
| Prompt (título3xx, cuerpo2, etc.) | A series of template components that generate the subject line and body text for notification emails, dynamically inserting the website name and status code. | Website name and status code from the routed data. | Formatted email subject or body text. |
| Gmail Message | Sends the final notification email using the generated subject and body. | Recipient email address, email subject, and email body. | Confirmation of the sent email. |
🧠 Notes
- The workflow is designed to process multiple websites in parallel for efficiency.
- It requires valid Google API credentials for accessing Google Sheets and Gmail.
- The notification logic is triggered only for non-200 status codes (redirections and errors).
- The email recipient and templates are pre-configured and should be adjusted for production use.
- The workflow assumes the input Google Sheet has columns named
nombre_sitiowebandurl.