Quick overview
This workflow runs every five minutes to find unlabelled Gmail messages, classifies each email with TypeSafe Jev (System One), creates any missing Gmail labels, and applies the chosen label based on model confidence so your inbox is automatically organized with a safe “Needs Review” fallback.
How it works
- Runs every five minutes and searches Gmail for up to 50 messages that have no user labels (excluding chats, sent mail, and drafts).
- Sends each email’s headers, snippet/body, and Gmail category signals to TypeSafe Jev (System One) to return a single label choice plus confidence and a “needs reply” score.
- Chooses the final label name by applying confidence thresholds, escalating uncertain-but-actionable emails to “Action Required,” and routing low-confidence results to “Needs Review.”
- Compares the needed label names with existing Gmail labels and creates any missing labels once to avoid duplicates.
- Reloads Gmail labels to get fresh label IDs, resolves the chosen label name to a label ID, and applies the label to each message.
- Repeats the search-and-label cycle within the same execution until the backlog is drained or the maximum rounds limit is reached.
Setup
- Add a Gmail OAuth2 credential with permission to read messages and manage labels, and select it for all Gmail steps.
- Add an HTTP Bearer Auth credential containing your TypeSafe API key and select it for the TypeSafe Jev request.
- Review and adjust the confidence thresholds (CONFIDENCE_FLOOR and NEEDS_REPLY_FLOOR) and ensure Gmail has (or can create) the “Needs Review” label used as a fallback.
- Optionally edit the label criteria taxonomy sent to TypeSafe Jev to match the categories you want created and applied in Gmail.