workflows.fit
Back to n8n workflows
n8n templateFreeBy Pratistha Thapa

Handle support reply approvals with Slack, Gmail and Google Sheets

Quick Overview This workflow receives Slack interactive button clicks for support ticket approvals, looks up the matching ticket in Google Sheets, and then either replies to the customer via Gmail or records a Needs E...

Data & StorageProductivityDevelopmentCore NodesCommunicationHITLCodeSwitch
Loading interactive preview...

Template notes

Quick Overview This workflow receives Slack interactive button clicks for support ticket approvals, looks up the matching ticket in Google Sheets, and then either replies to the customer via Gmail or records a Needs Edit/Rejected decision and updates the original Slack message.

How it works 1. Receives a Slack interactivity POST request when a reviewer clicks an Approve, Needs Edit, or Reject button. 2. Parses the Slack payload to extract the ticketid, decision, reviewer details, and the Slack channel and message timestamp to update. 3. Looks up the matching ticket row in Google Sheets using the ticketid. 4. Builds a shared context that combines the ticket data with reviewer metadata and chooses the reply text from finalreply or suggestedreply. 5. If the decision is approve, replies to the customer email thread in Gmail using the stored Gmail message ID, marks the ticket as Sent in Google Sheets, and updates the original Slack message to show “Approved and sent”. 6. If the decision is needsedit, updates the ticket status to Needs Edit in Google Sheets and updates the original Slack message to indicate edits are required. 7. If the decision is reject, updates the ticket status to Rejected in Google Sheets and updates the original Slack message to confirm rejection and that no email was sent.

Setup 1. In your Slack app, enable Interactivity and set the Interactivity Request URL to this workflow’s production webhook URL for the configured path. 2. Add a Google Sheets OAuth2 credential and set the Spreadsheet ID and Sheet tab for the ticket table, ensuring it contains columns like ticketid, suggestedreply/finalreply, gmailmessageid, slackchannel, slackmessagets, and status. 3. Add a Gmail OAuth2 credential for the mailbox that should send replies, and ensure each ticket row stores the correct gmailmessageid for replying. 4. Create an HTTP Header Auth credential for the Slack Web API (Bearer token) and verify it has permission to call chat.update in the target workspace.