School/Advanced Workflows/Automation Foundations
3/4
Wave 712 minintermediate

Triggers, Actions & Data Flow

Master the mechanics of building reliable automations.

Triggers, Actions & Data Flow

Understanding how data flows through an automation is the key to building workflows that actually work. This lesson covers the mechanics.

Trigger Types Deep Dive

Instant Triggers (Webhooks)

Fire the moment an event happens:

  • New form submission
  • New email received
  • Stripe payment processed
  • Slack message posted

Advantage: Real-time response

Use when: Speed matters (customer-facing workflows)

Scheduled Triggers (Polling)

Run on a timer:

  • Every 15 minutes: check for new leads
  • Daily at 9 AM: generate the morning report
  • Weekly on Monday: compile the weekly metrics
  • Monthly on the 1st: run the month-end analysis

Advantage: Predictable, controlled execution

Use when: Batch processing is fine (reports, digests, monitoring)

Manual Triggers

Started by a human action:

  • Click a button in Slack
  • Fill out a form
  • Send a specific email command

Advantage: Human controls when it runs

Use when: The workflow needs human judgment to start

Data Mapping Mastery

Every step in a workflow produces output data. The next step can use that data as input. This is called data mapping.

Example: Lead Processing Workflow

Step 1 - Trigger: New Typeform submission
  Output: {name: "Sarah Chen", email: "sarah@company.com",
           company: "TechCorp", message: "Interested in enterprise plan"}

Step 2 - AI Classification
  Input: Step 1's message field
  Prompt: "Classify this lead: hot/warm/cold based on..."
  Output: {classification: "hot", reasoning: "Explicitly mentioned enterprise plan"}

Step 3 - CRM Creation
  Input: name from Step 1, email from Step 1,
         classification from Step 2
  Output: {crm_id: "lead_123", created: true}

Step 4 - AI Email Draft
  Input: name from Step 1, company from Step 1,
         classification from Step 2
  Prompt: "Draft a follow-up email for a hot lead..."
  Output: {email_draft: "Hi Sarah, thanks for your interest..."}

Step 5 - Send Email
  Input: email from Step 1, email_draft from Step 4
  Output: {sent: true, message_id: "msg_456"}

Notice how each step can reference data from ANY previous step, not just the one immediately before it.

Error Handling

What happens when a step fails? Robust workflows plan for failure.

Common Failure Points

  • API rate limits: Too many requests too fast
  • Invalid data: Missing required fields, wrong format
  • Service outages: The connected app is temporarily down
  • AI errors: Model returns unexpected format or hallucinated data

Error Handling Strategies

Retry logic: If a step fails, try again (with a delay):

  • Attempt 1: Immediate
  • Attempt 2: Wait 1 minute
  • Attempt 3: Wait 5 minutes
  • If all fail: Send alert to admin

Fallback paths: If the primary action fails, do something else:

  • If AI classification fails → default to "unclassified" and route to human review
  • If CRM creation fails → save to a Google Sheet as backup
  • If email send fails → queue for manual sending

Validation steps: Check data before using it:

  • Is the email address valid format?
  • Is the required field non-empty?
  • Did the AI return a valid classification (not something off-list)?

Conditional Logic (Branching)

Real workflows aren't linear. They branch based on conditions:

IF/ELSE Branching

IF lead_score >= 80 → Hot lead path (immediate call)
ELSE IF lead_score >= 50 → Warm lead path (email sequence)
ELSE → Cold lead path (nurture campaign)

Switch/Router

For multiple paths:

SWITCH on email_category:
  "billing" → Route to finance team
  "technical" → Route to support team
  "sales" → Route to sales team
  "other" → Route to general inbox

Parallel Paths

Some actions can happen simultaneously:

Trigger: New customer signup
  → Path A: Send welcome email (immediate)
  → Path B: Create CRM record (immediate)
  → Path C: Schedule onboarding call for tomorrow (immediate)
  → Path D: Add to newsletter list (immediate)
All four happen at once.

Performance Tips

  • Minimize AI calls: Each API call takes time and money. Batch when possible.
  • Use caching: If you classify the same type of data repeatedly, cache results.
  • Set timeouts: Don't let a stuck step block the entire workflow.
  • Log everything: Store inputs, outputs, and errors for debugging.
  • Start simple: Build the core workflow first, add branches and error handling later.

Exercises

0/3
Prompt Challenge+20 XP

Design a complete data flow diagram for a workflow. Include: trigger, at least 3 action steps (one must be AI), data mapping between each step (what data passes from where to where), and error handling for 2 potential failure points.

Hint: Use the lead processing example as a template. Map out exactly which fields each step produces and which fields each subsequent step consumes.

Quiz+5 XP

What should happen when an AI classification step fails in an automated workflow?

Quiz+5 XP

What is the difference between instant triggers and scheduled triggers?