Data, Prompts & Code Workbench

AI Workflow & Automation Advisor

Decide what to automate with deterministic rules, where an AI step genuinely adds value, and where a human must stay in the loop. Designed for operations managers, founders, and team leads using tools like Zapier, Make, n8n, Google Workspace, or custom scripts, this workbench breaks a manual process into a step-by-step architecture with failure recovery and a weekend pilot plan.

1. Configure Inputs

Stateful DO Session
Quick-fill sample:

2. Workbench Output & Refinements

Sample preview (#1) — click Run Agent for live output

Rules vs. AI Split

  • Use deterministic rules for: Filtering out disposable email domains, checking if the form's numeric team_size field is >= 10, and deduplicating against existing rows in Google Sheets.
  • Use an AI step for: Classifying the free-text inquiry into 1 of 5 industry buckets, summarizing the buyer's core pain point in one line, and writing a tailored Gmail draft (never auto-sent).

Step-by-Step Workflow Blueprint

  1. Trigger & Input Validation: Make watches new Webflow form submissions, normalizes the email to lowercase, and checks a Google Sheets tab for an existing row with that email in the last 30 days.
  2. Deterministic Pre-Processing: A standard router checks the dropdown team_size. Leads under 10 seats route directly to a self-serve resources template without calling the LLM.
  3. Structured AI Step: For 10+ seat leads, pass company_name, role, and inquiry_text to an LLM requesting strict JSON: { "industry": "...", "pain_summary": "...", "questions_asked": [...], "draft_reply_body": "..." }.
  4. Human-in-the-Loop Checkpoint: Create a Gmail Draft (not a sent email) in the rep's inbox and post a Slack notification with the summary and a link to review the draft.
  5. Final Action & Logging: Append the structured fields, timestamp, and draft status to the Google Sheets tracker.

Failure Modes & Guardrails

  • Form spam or prompt injection: Strip URLs from inquiry_text and cap input at 1,000 characters before passing to the LLM.
  • Blank or cryptic messages: Instruct the prompt that if inquiry_text contains fewer than 5 words, use a standard discovery question template rather than guessing the prospect's industry.

2-Hour Pilot Plan

Export last week's 15 form submissions to a test Google Sheet. Run the structured prompt manually on those 15 rows first and have your sales rep grade whether the Gmail drafts needed heavy editing before wiring up the live Make webhook.

You will get a rules-vs-AI split, a 5-stage automation pipeline with human checkpoints, failure guardrails, and a 2-hour pilot plan.

Multi-Turn Refinement Chips (Same Session)

3 Curated Worked Examples

Inspect real sample inputs and structured deliverables for the AI Workflow & Automation Advisor. Click Try in Workbench on any example to load its parameters into the form above.

Example 1: Inbound B2B lead triage and Gmail draft generation

Describe the repetitive workflow you do manually today: When prospects submit our website contact form, an ops coordinator copies their message... Apps and tools your team already uses: Webflow forms, Google Sheets, Gmail, Slack, Make Human review & error tolerance: Human approves every output before sending (Draft mode) Tone: Pragmatic Operations Lead

Rules vs. AI Split

  • Use deterministic rules for: Filtering out disposable email domains, checking if the form's numeric team_size field is >= 10, and deduplicating against existing rows in Google Sheets.
  • Use an AI step for: Classifying the free-text inquiry into 1 of 5 industry buckets, summarizing the buyer's core pain point in one line, and writing a tailored Gmail draft (never auto-sent).

Step-by-Step Workflow Blueprint

  1. Trigger & Input Validation: Make watches new Webflow form submissions, normalizes the email to lowercase, and checks a Google Sheets tab for an existing row with that email in the last 30 days.
  2. Deterministic Pre-Processing: A standard router checks the dropdown team_size. Leads under 10 seats route directly to a self-serve resources template without calling the LLM.
  3. Structured AI Step: For 10+ seat leads, pass company_name, role, and inquiry_text to an LLM requesting strict JSON: { "industry": "...", "pain_summary": "...", "questions_asked": [...], "draft_reply_body": "..." }.
  4. Human-in-the-Loop Checkpoint: Create a Gmail Draft (not a sent email) in the rep's inbox and post a Slack notification with the summary and a link to review the draft.
  5. Final Action & Logging: Append the structured fields, timestamp, and draft status to the Google Sheets tracker.

Failure Modes & Guardrails

  • Form spam or prompt injection: Strip URLs from inquiry_text and cap input at 1,000 characters before passing to the LLM.
  • Blank or cryptic messages: Instruct the prompt that if inquiry_text contains fewer than 5 words, use a standard discovery question template rather than guessing the prospect's industry.

2-Hour Pilot Plan

Export last week's 15 form submissions to a test Google Sheet. Run the structured prompt manually on those 15 rows first and have your sales rep grade whether the Gmail drafts needed heavy editing before wiring up the live Make webhook.

Example 2: Weekly vendor invoice PDF intake and exception flagging

Describe the repetitive workflow you do manually today: Suppliers email PDF invoices to ap@company. We open each PDF, check if the total matche... Apps and tools your team already uses: Google Workspace (Gmail + Drive + Sheets), Excel, Zapier Human review & error tolerance: Auto-run routine cases; flag exceptions for human review Tone: Risk-First Advisor

Rules vs. AI Split

  • Use deterministic rules for: Matching the extracted PO number against your approved PO sheet, computing whether abs(invoice_total - po_total) <= 0.01, and checking for duplicate vendor + invoice_number keys.
  • Use an AI step for: Extracting structured fields (vendor_name, invoice_number, po_number, due_date, line_items, total_amount) from varied supplier PDF layouts.

Step-by-Step Workflow Blueprint

  1. Trigger & Input Validation: Zapier watches the ap@ label for emails with PDF attachments, saves the raw PDF to a dated Google Drive folder, and logs the file URL.
  2. Structured AI Step: Send the document text/vision payload to an extraction model with a strict JSON schema where unreadable fields must return null.
  3. Deterministic Pre-Processing: Look up po_number in your approved PO tab and run three hard checks in code: (a) no null required fields, (b) sum of line items equals total_amount, and (c) total_amount matches the open PO balance.
  4. Human-in-the-Loop Checkpoint: Invoices passing all three checks land in the Ready for Import sheet tab. Any mismatch or null field routes to a Needs Review tab and posts a Slack alert linking the Drive PDF.
  5. Final Action & Logging: Finance reviews the batch sheet once before exporting the CSV to accounting.

Failure Modes & Guardrails

  • Math hallucinations on multi-page PDFs: Never let the LLM calculate subtotals; extract both individual line totals and the printed grand total, then verify their sum in a spreadsheet formula.
  • Duplicate email forwarding: Key every row on LOWER(vendor_name) + "-" + invoice_number so forwarded threads do not double-stage an invoice.

2-Hour Pilot Plan

Gather 10 past supplier PDFs (including one credit memo and one multi-page invoice). Run them through the JSON extraction prompt and verify your spreadsheet reconciliation formula catches mismatches 100% of the time before connecting Gmail triggers.

Example 3: Sprint release notes compiler from merged tickets

Describe the repetitive workflow you do manually today: Every second Thursday a product manager reads 35 closed Jira/Linear tickets, groups the... Apps and tools your team already uses: Linear, Notion, Slack Human review & error tolerance: Internal back-office task (low external risk) Tone: No-Hype Architect

Rules vs. AI Split

  • Use deterministic rules for: Querying tickets closed in the current sprint cycle, excluding tickets tagged internal-chore or infra, and grouping items by their existing ticket labels.
  • Use an AI step for: Translating terse engineering titles and PR descriptions into clear, jargon-free customer bullet points and flagging tickets that lack enough context to describe accurately.

Step-by-Step Workflow Blueprint

  1. Trigger & Input Validation: A scheduled Thursday morning workflow pulls all issues marked Done in the active Linear cycle along with their labels and description body.
  2. Deterministic Pre-Processing: Filter out internal infrastructure tickets by label so the LLM never accidentally exposes internal refactors in public release drafts.
  3. Structured AI Step: Feed the filtered ticket JSON array to the LLM with instructions to group bullets under ## New & Improved and ## Bug Fixes, preserving the exact ticket ID (e.g., [ENG-412]) next to each bullet for traceability.
  4. Human-in-the-Loop Checkpoint: Create a draft Notion page in the Release Notes database and tag the PM in Slack to review any bullet marked [Needs PM Clarification].
  5. Final Action & Logging: PM edits the Notion draft, strips the internal [ENG-412] IDs, and publishes.

Failure Modes & Guardrails

  • Empty ticket bodies: Engineers often close tickets with only a title like "Fix webhook race condition". Instruct the prompt to append [Verify user impact with engineering] rather than inventing customer-facing details.
  • Over-hyped marketing tone: Ban words like "revolutionary" or "seamlessly" in the system prompt so release notes stay factual.

2-Hour Pilot Plan

Export your last completed sprint as a CSV from Linear, drop the non-internal rows into the prompt Optimizer workbench, and compare the generated Markdown draft against the release notes you wrote by hand last sprint.

Practical Workflow Tips

How to get sharper, more reliable results from this workbench and verify output before publishing or shipping.

  • Never use an LLM for math, date comparisons, deduplication, or simple keyword routing—handle those steps with spreadsheet formulas or standard conditional filters and reserve the AI step for unstructured text.
  • Start every external-facing workflow in 'Draft mode' where the automation creates a Gmail draft, Notion page, or Slack preview for human approval until you have reviewed at least 50 real runs.
  • Require the AI node in your workflow to return strict JSON with an explicit confidence or needs_human_review boolean so your router can automatically sideline ambiguous edge cases.
  • Log the raw input, prompt version, and raw model output to a cheap spreadsheet or database table during your first month so you can debug why a weird output happened.

Frequently Asked Questions

How do I know whether a workflow step should use a deterministic rule or an AI prompt?

Ask whether the input and decision logic can be expressed with exact fields—such as checking if a deal value exceeds $5,000, matching a SKU in a table, or formatting a date. If yes, use a deterministic filter or formula because it runs instantly, costs nothing, and never hallucinates. Use an AI prompt only when interpreting unstructured human language, messy documents, or nuanced summaries.

Why should I build a 2-hour pilot before setting up triggers in Zapier, Make, or n8n?

Most automation failures come from messy edge-case data and vague prompts rather than the webhook plumbing itself. Testing your prompt and validation rules manually on 10 to 15 historical rows reveals missing fields, formatting quirks, and false positives in minutes without risking live inbox misfires.

How do I prevent an automated AI workflow from sending embarrassing errors to customers?

Design the automation to prepare the work rather than press the final send button. Having the workflow enrich the record, check constraints, and stage a draft email or ticket reply gives you most of the time savings while keeping a 10-second human review gate between the model and your customer.