1. Opening Problem Statement
Meet Sarah, a dedicated IT dispatch coordinator managing dozens of client support tickets daily via ConnectWise. From 8 AM to 4 PM, Monday through Friday, Sarah scrambles to monitor new tickets on multiple ConnectWise boards—filtering, copying, and sending alerts manually to her dispatch team on Microsoft Teams. This repetitive routine costs her over two hours each day and risks missing new urgent tickets, leading to delayed responses and frustrated clients.
With hundreds of tickets in various statuses and boards, the manual tracking invites human error—duplicate alerts clutter her Teams channel, and sometimes new tickets slip through unnoticed. Sarah needs a reliable method that automatically fetches, filters, groups, and dispatches new ticket alerts to Teams in a clean, timely manner, preserving her time while improving the team’s responsiveness.
2. What This Automation Does
This n8n workflow called “New Ticket Alerts to Teams” streamlines Sarah’s ticket monitoring by automating the entire alert process with these specific outcomes:
- Automatic scheduled fetching of all new tickets from multiple ConnectWise boards during business hours (8-4 PM, weekdays) every minute.
- Filters out tickets already alerted by cross-referencing Redis cache entries to avoid duplicate notifications.
- Groups tickets by company and site with ticket type details for easier, organized alert messages.
- Sends formatted HTML alerts directly to a specified Microsoft Teams channel as clean, readable chat messages.
- Logs ticket IDs in Redis to maintain the memory of dispatched alerts.
- Improves team responsiveness and cuts manual effort, saving Sarah roughly 10+ hours a week.
3. Prerequisites ⚙️
- ConnectWise account with API access and clientId for new tickets retrieval.
- Microsoft Teams account with access token and chat ID to post messages.
- Redis database for caching already alerted ticket IDs.
- n8n workflow automation platform account to run and schedule the workflow.
- API credentials configured in n8n for ConnectWise HTTP and Redis nodes.
4. Step-by-Step Guide
Step 1: Set Up the Schedule Trigger
Navigate to the n8n editor, click + Add Node → Select Schedule Trigger. Configure the cron expression */1 8-16 * * 1-5 to run the workflow every minute from 8 AM to 4 PM Monday through Friday. You should see a green check mark confirming the cron setup.
Common mistake: Forgetting to restrict running hours results in alerts 24/7, which isn’t intended here.
Step 2: Retrieve New Tickets via HTTP Request Node
Add an HTTP Request node named “Get New Tickets”. Configure the URL to ConnectWise API endpoint to fetch tickets with status “New” or related states, filtered by specific board IDs and without a parent ticket. Example URL:
https://na.myconnectwise.net/v4_6_release/apis/3.0/service/tickets?conditions=(status/name="New" or status/name="New (email)" or status/name="New (portal)") and (board/id=25 or board/id=26 or board/id=1 or board/id=28) and parentTicketId=null&PageSize=999.
Set authentication using generic header auth with a clientId header. After execution, verify the node returns JSON arrays of new tickets.
Common mistake: Omitting valid credentials causes request failures or empty data.
Step 3: Query Redis Database to Filter Previously Notified Tickets
Add the Redis node configured to perform a GET operation keyed by each ticket ID (converted to string in the next code step). Credentials must connect properly to your Redis instance.
This operation helps check if the ticket has been alerted before.
Common mistake: Incorrect Redis key conversion or connection leads to missing cache results.
Step 4: Add Filterable Parameter with the Code Node
Insert a Code node named “Add Filterable Parameter”. Paste the following JavaScript snippet to convert each ticket ID to a string and add a new JSON property to facilitate filtering in the merge node:
for (const item of $input.all()) {
item.json.id = item.json.id.toString();
item.json.FilterOnThis = item.json.id;
}
return $input.all();
This ensures smooth fuzzy comparing in the merge node later.
Step 5: Filter Out Already Dispatched Tickets with Merge Node
Add a Merge node named “Filter Out Tickets that have already been sent”. Set mode to Combine, join mode to keep non-matches, join by fields FilterOnThis and Redis Tickets.
This filters out tickets that have matching Redis keys, meaning they’ve been notified already.
Common mistake: Using wrong join mode or incorrect field names results in duplicates or missed filtering.
Step 6: Combine Tickets by Company and Site
Add another Code node labeled “Combine like Companies”. Paste this JS logic that groups tickets by siteName and company, concatenating ticket IDs and summaries with HTML line breaks:
return Object.values(items.reduce((accumulator, current) => {
const siteName = current.json.siteName;
const companyName = current.json.company;
const ticketType = current.json.recordType;
const groupKey = `${siteName} - ${companyName}`;
if (!accumulator[groupKey]) {
accumulator[groupKey] = {
siteName,
companyName,
ticketType,
tickets: []
};
}
const ticketInfo = `${current.json.id}: ${current.json.summary}
`;
accumulator[groupKey].tickets.push(ticketInfo);
if (!accumulator[groupKey].ticketType) {
accumulator[groupKey].ticketType = ticketType;
} else if (accumulator[groupKey].ticketType !== ticketType) {
accumulator[groupKey].ticketType += `, ${ticketType}`;
}
return accumulator;
}, {})).map(group => {
const ticketsString = group.tickets.join('');
return {
siteName: group.siteName,
companyName: group.companyName,
ticketType: group.ticketType,
tickets: ticketsString
};
});
This generates clean grouped data for alert messages.
Step 7: Send Alerts to Microsoft Teams
Use the Microsoft Teams node named “Teams to Dispatch”. Set message type to HTML and compose a message like this:
Hey Dispatch Team!, A new {{ $json.ticketType }} has come in.
Ticket: {{ $json.tickets }} Company: {{ $json.companyName.name }}Configure the chatId and connect OAuth2 credentials. After running, verify messages appear in your specified Teams chat.
Common mistake: Wrong chatId or invalid credentials block message delivery.
Step 8: Log Dispatched Ticket IDs to Redis
Finally, add a Redis node called “Log in Redis” to store sent ticket IDs as key-value pairs. This prevents duplicate alerts in future runs.
Use the ticket ID as both key and value.
5. Customizations ✏️
- Adjust Scheduling Interval: In the Schedule Trigger node, modify the cron expression to run more or less frequently, e.g., every 5 minutes for less noise.
- Add Additional Ticket Filters: In the HTTP Request node, extend the URL query to include more boards or statuses based on your team’s needs.
- Change Teams Chat Target: Update the Teams to Dispatch node’s chatId to alert different Teams channels or users.
- Modify Grouping Logic: Adapt the grouping code node to group by ticket priority or other fields relevant to your workflow.
- Customize Message Formatting: Change the HTML template inside the Teams node for brand colors, more fields, or emojis.
6. Troubleshooting 🔧
Problem: “HTTP Request Node returns no tickets or empty response”
Cause: Incorrect API URL, missing or invalid authentication.
Solution: Re-check the ConnectWise API URL and clientId header in the HTTP Request node settings. Test your credentials separately via Postman or cURL.
Problem: “Redis GET operation fails or returns unexpected data”
Cause: Redis connection credentials incorrect or key data type mismatch.
Solution: Verify Redis credentials in n8n under credentials tab, ensure keys are strings.
Problem: “Microsoft Teams node does not send message”
Cause: Incorrect chatId or expired OAuth token.
Solution: Regenerate OAuth credentials and verify chatId is correct. Test message manually via Teams API if possible.
7. Pre-Production Checklist ✅
- Verify API credentials (ConnectWise and Redis) are correct and active.
- Test that the Schedule Trigger fires only during desired hours and days.
- Run a manual trigger and confirm new tickets are fetched from ConnectWise.
- Check Redis for proper storage of ticket IDs after alerts are sent.
- Confirm Teams messages display correctly with all ticket details.
- Backup n8n workflow JSON before deploying to production.
8. Deployment Guide
Activate the workflow by toggling the Active switch in n8n. Ensure your n8n instance remains running during business hours for consistent alerts.
Monitor workflow executions in the Execution List to spot any errors or failures immediately.
If self-hosting n8n, consider robust hosting like Hostinger (https://buldrr.com/hostinger) for uptime guarantees.
9. FAQs
Q: Can this workflow be adapted for other ticketing systems?
A: Yes, by changing the HTTP Request node URL and data parsing to fit the new system’s API.
Q: Does using Redis increase costs?
A: Redis often runs on inexpensive cloud tiers or local servers. The workflow uses minimal GET/SET calls, so costs remain low.
Q: Is my ticket data secure?
A: Data is transmitted over HTTPS and stored temporarily in Redis only as ticket IDs to prevent duplicates. Credentials are stored securely in n8n.
10. Conclusion
By building this “New Ticket Alerts to Teams” workflow, you’ve automated a critical yet tedious task of alerting your dispatch team about new ConnectWise tickets instantly. This saves hours spent on manual monitoring, reduces errors in ticket handling, and improves response times to client issues.
Next, you might explore automations to escalate tickets that remain open too long or integrate with Slack for cross-team notifications.
Keep experimenting with n8n’s versatile nodes to build workflows tailored exactly to your operations. Your team’s productivity—and your sanity—will thank you for it.