n8n checks Zendesk tickets against SLA deadlines, alerting the team via Slack if a breach is imminent.
1. Prepare n8n Environment
Navigate to http://localhost:5678 (or your n8n URL) and log in with your credentials. In the sidebar, click “Workflows,” then select “+ New” and name it (e.g., “SLA Monitor”). Click “+” on the canvas to open the node selector.
2. Trigger Node: Cron
Node: Cron
Settings:
Output: Periodic trigger.
3. Fetch Tickets Node: Zendesk
Node: Zendesk
Settings:
Output: Open tickets (e.g., {{ $json.tickets[0].created_at }}).
4. Check SLA Node: Function
Node: Function
Settings:
Code:
const created = new Date($node["Zendesk"].json.tickets[0].created_at);
const now = new Date();
const hours = (now - created) / 1000 / 60 / 60;
return [{ json: { atRisk: hours > 4 } }]; // SLA: 5 hours
Output: SLA status.
5. Alert Node: Slack
Node: Slack
Settings:
Output: Alert sent if at risk.
Cron Fail: Check expression syntax.
SLA Logic: Verify Function code.
Ready to transform your business with our technology solutions? Contact Us today to Leverage Our AI/ML Expertise.