How to Automate Email Triage With Pipedream
How to automate email triage with Pipedream: a Gmail trigger, a classification step, and Gmail actions that label and archive. Workflows ends March 31, 2027.
By Galactic News Editorial · Published 2026-11-07T15:04:05+00:00 · Updated 2026-11-07T15:04:05+00:00
How to Automate Email Triage With Pipedream
Read this first: Pipedream Workflows shuts down on March 31, 2027. Pipedream announced that Workflows and String will stop on that date, no longer accept signups or subscriptions, and have all Workflows data permanently deleted by April 30, 2027. Pipedream Connect is not affected. The steps below are for existing Workflows accounts. If you do not already have a Workflows account, do not build on it. Use the pattern here as a design reference and build on a platform that accepts new users.
With that warning in place, here is the job. Email triage means sorting incoming mail into buckets the moment it arrives: urgent, support, sales, newsletter, and noise. Pipedream does it with a Gmail trigger, a small code step that classifies each message, and Gmail actions that label, archive, or forward. The whole flow runs on Pipedream's servers once deployed. This is a research-based tutorial, not a hands-on walkthrough.
Automate email triage with Pipedream: what you build
The workflow has four parts. A Gmail trigger fires when a matching email arrives. A code step reads the subject and sender and assigns a label such as urgent, support, sales, or newsletter. Gmail actions apply the label and archive what needs no reply. An optional notification step posts the urgent ones to Slack or email. Pipedream lists more than 10,000 prebuilt triggers and actions across 3,000-plus apps, so the same pattern works with Outlook or any other mail app once the trigger changes.
Step 1: Create the workflow and pick the Gmail trigger
Open your existing Pipedream Workflows account and create a new workflow. Choose Gmail as the trigger app and pick the New Email Matching Search trigger. This trigger emits an event when an email matching your search criteria arrives, and it is capped at 100 new messages per run. Connect your Gmail account through OAuth when prompted. Pipedream opens a popup where you sign in to Google and grant access. Set the search query to the mail you want to triage. A query such as is:inbox catches everything. A narrower query such as from:client.com OR subject:support limits the flow to the mail that matters. Start narrow. You can widen the query later.
Step 2: Add a code step that classifies each email
Add a code step after the trigger. Pipedream workflows mix prebuilt actions with real Node.js, Python, Go, or Bash code, with npm and PyPI packages available. The step below reads the subject and sender from the trigger event and returns a label. Adapt the field names to the event your trigger emits: send a test event first and inspect its shape before you write the logic.
// Classify the incoming email by subject and sender keywords
const event = steps.trigger.event;
const subject = (event.subject || "").toLowerCase();
const from = (event.from || "").toLowerCase();
let label = "newsletter";
if (subject.includes("urgent") || subject.includes("outage") || subject.includes("down")) {
label = "urgent";
} else if (from.includes("support") || subject.includes("help") || subject.includes("bug")) {
label = "support";
} else if (subject.includes("quote") || subject.includes("pricing") || subject.includes("demo")) {
label = "sales";
}
return { label, subject: event.subject, from: event.from };Keep the rules simple. Keyword matching on subject and sender covers most triage. If a message matches nothing, it falls through to the default label. Review the default bucket weekly and add keywords for the mail that keeps landing there.
Step 3: Add Gmail actions that label and archive
Add a Gmail action step after the code step. Use the action that adds a label to the message, and pass it the label your code step returned. Add a second action for the buckets that need no reply: archive the message so it leaves the inbox but stays searchable. For the urgent bucket, add a notification step instead of archiving. A Slack message or a plain email to your phone keeps urgent mail visible. One trigger can feed several actions, so build one branch per label and keep each branch to a single job.
Step 4: Test with a test event, then deploy
Send a test event from the trigger configuration before you deploy. Pipedream lets you inspect the event payload and the output of each step. Send yourself three test emails: one urgent, one support, one newsletter. Check that each lands in the right bucket. Fix the keywords when one lands wrong. Then deploy the workflow. Deployed workflows run on Pipedream's servers around the clock. Check the run history in the first week and watch for two failures: mail that lands in the wrong bucket, and runs that time out on slow steps.
Step 5: Watch the cost and the deadline
Workflows meter compute in credits, where one credit equals 30 seconds of compute at 256 MB of memory. A triage flow that runs in a few seconds costs a fraction of a credit per email. The old free tier carried a small daily credit allowance, but new signups are closed, so the plan that matters is the one your account already holds. The real cost here is the deadline. Workflows stop on March 31, 2027. Export your project before then: Pipedream's export tool downloads each project as a ZIP of JSON files describing triggers, steps, code, and settings. Rebuild the same pattern on your next platform while the original still runs, and cut over before the shutdown date.
Quick checklist
- Pick the Gmail New Email Matching Search trigger and set a narrow search query.
- Connect Gmail through OAuth.
- Add a code step that assigns one label per message.
- Add Gmail actions that label, archive, or notify by bucket.
- Test with three sample emails, then deploy.
- Export the project before March 31, 2027.
Bottom line
Email triage on Pipedream is a Gmail trigger, a short classification step, and Gmail actions that label and archive. Build it with a narrow search query, test it with three sample emails, and deploy. But do not start new work on Workflows. It shuts down on March 31, 2027, and all Workflows data is deleted by April 30, 2027. If you already run this flow, export it now and plan the move. If you are starting fresh, take this pattern to a platform that accepts new users.