Category: Builder's Corner
Keyword: Google Duet AI workflow tutorial 2026
Approval workflows are the backbone of modern business automation, ensuring the right checks and balances before any critical action occurs. With Google Duet AI’s 2026 workflow features, you can now build robust, AI-powered approval processes with minimal code—directly integrated into your Google Workspace. This tutorial will walk you step-by-step through building a dynamic approval workflow, complete with prompt logic, notifications, and human-in-the-loop review, using Google Duet AI’s latest capabilities.
As we covered in our complete guide to AI workflow prompt engineering, approval flows are a cornerstone use case for prompt-based automation. Here, we’ll take a deeper dive into practical implementation, so you can get hands-on with Duet AI and start automating your own business approvals.
Prerequisites
- Google Workspace Admin access (for configuring Duet AI and integrations)
- Google Duet AI for Workspace (2026 release, with Workflow Builder enabled)
- Google Apps Script (for custom logic, version ≥ 2026.2)
- Basic JavaScript knowledge (for scripting conditions and actions)
- Familiarity with Google Sheets and Gmail APIs (for data storage and notifications)
- Optional: Access to Google Cloud Console (for advanced integrations)
1. Set Up Your Approval Data Source in Google Sheets
-
Create a new Google Sheet for tracking approvals:
- Go to Google Sheets and create a new file named
Approvals Tracker.
- Go to Google Sheets and create a new file named
-
Define your columns:
- Add columns:
Request ID,Requester Email,Request Details,Status,Approver Email,Decision,Timestamp.
- Add columns:
-
Share the sheet with Duet AI:
- Click Share, add your Duet AI service account (typically
duet-ai@[yourdomain].iam.gserviceaccount.com), and grant Edit access.
- Click Share, add your Duet AI service account (typically
(Screenshot description: Google Sheet with the above columns, a few example rows, and the Share dialog open.)
2. Enable Google Duet AI Workflow Builder
-
Access Workflow Builder:
- From Google Workspace, click the Duet AI icon in the sidebar and select Workflow Builder.
-
Create a new workflow:
- Click + New Workflow and name it
Approval Process.
- Click + New Workflow and name it
-
Set trigger:
- Choose On New Row in Google Sheet as your trigger.
- Select your
Approvals Trackersheet and the relevant tab.
(Screenshot description: Duet AI Workflow Builder interface showing trigger selection connected to the Approvals Tracker sheet.)
3. Add AI-Powered Approval Logic with Duet AI Prompts
-
Add an AI Decision Step:
- Click Add Step, choose AI Decision.
-
Configure the prompt:
- Enter a prompt such as:
You are an approval assistant. Review the following request details: - Request Details: {{Request Details}} - Requester: {{Requester Email}} If the request is for less than $1,000 and does not mention "urgent" or "exception", auto-approve. Otherwise, route to the approver. Return "APPROVE" or "ESCALATE".- Map
{{Request Details}}and{{Requester Email}}to columns from your sheet.
-
Set output variable:
- Name it
ai_decision.
- Name it
For more advanced prompt design, see 10 Proven Prompt Engineering Frameworks for AI Workflow Automation (2026 Guide).
4. Branch Workflow Based on AI Output
-
Add a Conditional Branch:
- Choose Condition step.
- Set the condition:
ai_decision == "APPROVE"
-
If APPROVE:
- Add a step: Update Google Sheet
- Set
StatustoApproved,DecisiontoAuto-Approved, andTimestampto=NOW().
-
If ESCALATE:
- Add a step: Send Email
- To:
{{Approver Email}} - Subject:
Approval Needed: Request {{Request ID}} - Body: Include
{{Request Details}}and a link to the sheet.
See sector-specific prompt templates in Prompt Templates That Work: Sector-Specific Examples for Legal, Finance, and HR Workflows.
5. Add Human-in-the-Loop Review (Apps Script Extension)
-
Open Google Apps Script:
- In your sheet, click Extensions > Apps Script.
-
Add a review function:
// Triggered when approver submits decision via custom UI or link function recordApprovalDecision(requestId, decision, approverEmail) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'); var data = sheet.getDataRange().getValues(); for (var i = 1; i < data.length; i++) { if (data[i][0] == requestId) { sheet.getRange(i+1, 4).setValue('Reviewed'); sheet.getRange(i+1, 5).setValue(approverEmail); sheet.getRange(i+1, 6).setValue(decision); sheet.getRange(i+1, 7).setValue(new Date()); break; } } } -
Deploy as a web app:
- Click Deploy > New deployment, select Web app.
- Set Who has access to
Anyone with the link(or restrict as needed).
-
Update email body in workflow:
- Include a link to the web app for the approver to submit their decision.
(Screenshot description: Apps Script editor showing the above function, and a web app deployment dialog.)
6. Notify Requester of the Outcome
-
Add a notification step:
- After either approval or review, add a Send Email step.
- To:
{{Requester Email}} - Subject:
Your request {{Request ID}} has been {{Decision}} - Body: Summary of the outcome, timestamp, and approver’s comments if any.
(Screenshot description: Duet AI Workflow Builder showing a notification email setup.)
7. Test the Workflow End-to-End
-
Submit a test request:
- Add a new row to your Approvals Tracker sheet with test data.
-
Check AI auto-approval:
- If the amount is under $1,000 and not urgent, the status should update automatically.
-
Test escalation:
- Submit a request that triggers escalation (e.g., amount over $1,000).
- Check that the approver receives an email with the decision link.
-
Complete human review:
- Follow the link as the approver, submit a decision, and verify the sheet updates and requester is notified.
For prompt debugging tips, refer to Best Prompt Debugging Tools for AI Workflows: 2026’s Top Picks and How to Use Them.
Common Issues & Troubleshooting
- Duet AI cannot access the Google Sheet: Double-check sharing permissions. The Duet AI service account must have Edit access to the sheet.
- AI Decision step not branching correctly: Verify your prompt output is strictly "APPROVE" or "ESCALATE". Add explicit instructions in the prompt if needed.
- Apps Script web app not updating the sheet: Ensure you’ve deployed the latest version, and the script has permission to edit the sheet. Test the web app directly.
- Emails not being sent: Check that Gmail API is enabled for your Workspace and that Duet AI has mail sending permissions.
- Workflow not triggering on new rows: Confirm the trigger is configured for the correct sheet and tab, and that the row is complete (no missing required columns).
For advanced approval flows (e.g., multi-stage, document extraction), see Prompt Engineering for Document AI: Real-World Templates for Approval and Extraction.
Next Steps
- Expand to multi-stage approvals: Add additional AI or human review steps for more complex workflows.
- Integrate with other platforms: Use Duet AI’s connectors for Slack, DocuSign, or third-party APIs for richer automation.
- Refine your prompts: Experiment with prompt templates and chaining for nuanced decision logic. For a no-code approach, see How to Build Prompt Chaining Workflows with No-Code AI Platforms (2026 Tutorial).
- Explore sector-specific best practices: Review Prompt Engineering for Automated Procurement Approvals: 2026’s Advanced Recipes for more industry-focused examples.
- Collaborate with your team: Share your workflow and invite feedback. For creative team use cases, check out AI-Driven Document Collaboration Workflows for Creative Teams.
By following these steps, you can leverage Google Duet AI’s workflow builder to create reliable, scalable approval pipelines tailored to your organization’s needs. For a broader framework and more examples, revisit our 2026 Playbook for AI Workflow Prompt Engineering.