Build Your Own Product Error Tracking Tool
Join our Discord Community
Get help, share your projects, and connect with other developers
WhatsApp Community
Stay updated with the latest features and announcements
Introduction
In this tutorial, we’ll build a proactive error tracking system for your product. Instead of waiting for customers to report issues, this system automatically detects errors, identifies the affected user, determines which team member should handle the issue, and sends appropriate notifications.
What We’ll Build
- A system that listens for errors on both frontend and backend
- Logic to identify which product line, user, and type of error occurred
- Automatic assignment to the appropriate developer based on the error source
- Immediate alert emails to both the support team and affected customer
- Database tracking for all issues with their resolution status
Prerequisites
- A WorqHat account (sign up at worqhat.com)
- Basic understanding of API requests
- A frontend application to integrate with (we’ll provide sample code)
Step 1: Create a Database Table
- Sign in to your WorqHat account and select your workspace
- Navigate to the Database section
- Create a new table called “user_issue_data” with the following columns:
- Document ID (automatically generated as primary key)
- user_id (string, not nullable)
- user_email (string, not nullable)
- description (string, nullable)
- issue_date (date, not nullable)
- issue_priority (string, not nullable)
- assigned_person (string, nullable)
- resolved_status (boolean, default: false)
Step 2: Create the Workflow
- Navigate to the Workflows section and click “Create Workflow”
- Name your workflow “Error Tracker”
- Select “URL based request” as the trigger type
Configure Workflow Input Parameters
The workflow will receive the following parameters from your application:
- user_id
- user_email
- error_name
- issue_id
- code_segment (identifies where the error occurred: ‘workflows’, ‘AI’, or ‘no_code’)
Step 2.1: Store Data in Database
- Add a “Store Data” action
- Configure it to store in your “user_issue_data” collection
- Map the input fields to your database columns by clicking on each field and selecting the appropriate variable from the dropdown list:
- Document ID: Click the field and select
issue_id
from the input variables - user_id: Click the field and select
userId
from the input variables - user_email: Click the field and select
userEmail
from the input variables - description: Click the field and select
errorName
from the input variables - issue_priority: Type “high” or click to create logic to determine priority
- resolved_status: Select “false” from the boolean options
- Document ID: Click the field and select
Step 2.2: Send Email to Customer
- Add a “Send Email” action
- Configure the email by clicking on each field and selecting variables where appropriate:
- From: Click and select errors@worqhat.com (or your custom domain)
- To: Click the field and select
userEmail
from the input variables - CC: Click and enter support@worqhat.com
- Subject: Click and enter “We noticed an error while you were using our product”
- Body: Click the text editor and draft a message notifying the customer that you’ve detected an error and are actively working to resolve it. You can include variables by clicking the
+
button and selecting from available variables.
Step 2.3: Create Switch Case for Error Source
- Add a “Switch Case” action
- Click the condition field and select
codeSegment
from the input variables - Create three cases by clicking “Add Case”:
- Case 1: Enter ‘workflows’
- Case 2: Enter ‘AI’
- Case 3: Enter ‘no_code’
- Add a default case by clicking “Add Default Case”
Step 2.4: Configure Team Notifications
For each case in the switch statement:
- Click the “Add Action” button within the case and select “Send Email”
- Configure the email to go to the appropriate team member:
- For ‘workflows’ errors: Click and enter workflows_team@yourdomain.com
- For ‘AI’ errors: Click and enter ai_team@yourdomain.com
- For ‘no_code’ errors: Click and enter nocode_team@yourdomain.com
- For the subject, click and enter “Error Alert: [Error Type] Error”
- For the body, click the text editor and include relevant details by clicking the
+
button to add variables:- User ID: Select
userId
from input variables - User email: Select
userEmail
from input variables - Error name: Select
errorName
from input variables - Issue ID: Select
issueId
from input variables
- User ID: Select
Step 2.5: Configure Return Value
For each case:
- Click the “Add Action” button and select “Return”
- Click the return value field and select
issueId
from input variables to confirm successful processing
Step 3: Test the Workflow
- Click the “Test” button in the workflow editor
- In the test panel, enter sample values for all required parameters:
- userId: “user123”
- userEmail: “test@example.com”
- errorName: “NullPointerException”
- issueId: “issue456”
- codeSegment: “workflows”
- Toggle on “Developer Mode” to see detailed execution steps
- Click “Run Test” and verify that emails are sent and data is stored correctly
Step 4: Integrate with Your Application
Create an API Key
- Navigate to API Keys in your WorqHat dashboard
- Create a new API key
- Whitelist the domains that will be calling your workflow
Frontend Integration
Add buttons to your HTML to trigger these functions:
Important Notes
Security
- Always whitelist domains that will be calling your workflow
- Use API keys with appropriate permissions
- Consider implementing additional authentication for sensitive operations
Scalability
WorqHat workflows run in separate containers, providing:
- High scalability for handling multiple parallel requests
- Enhanced security through isolation
- Improved performance
Extending the System
You can enhance this error tracking system by:
- Adding severity levels to prioritize issues
- Implementing automatic issue assignment based on team member availability
- Creating a dashboard to visualize error trends
- Setting up automatic follow-ups for unresolved issues
- Integrating with other communication channels like Slack or Microsoft Teams
Conclusion
You’ve built a proactive error tracking system that helps you identify and resolve issues before they significantly impact your users. This approach transforms support from reactive to proactive, improving customer satisfaction and product reliability.
This tutorial demonstrates just one of many ways to use WorqHat Workflows. The platform’s flexibility allows you to build complex automation systems without writing extensive backend code.
Remember to secure your API keys and only whitelist domains that need access to your workflows.
Was this page helpful?