Back to guides
2
4 min

Triggers & Actions

Event-Driven Thinking

Every Automation Has Two Parts

Every automation follows the same pattern: something happens (trigger), then something responds (action). Master this pattern and you can automate anything.

Triggers: What Starts the Workflow

A trigger is an event that kicks off your automation. Common triggers:

Trigger TypeExampleWhen It Fires
New dataNew email arrives, file uploadedImmediately on event
ScheduleEvery morning at 9am, every FridayOn a timer
ThresholdSupport queue > 50 ticketsWhen a condition is met
WebhookStripe payment received, GitHub PR openedExternal system notifies you
ManualUser clicks "Run" buttonOn demand

The best triggers are specific and frequent. "New email" is too broad — "New email from a customer with 'urgent' in the subject" is a trigger you can build a useful automation around.

Actions: What Happens Next

Actions are what your automation does when triggered. AI-powered actions go beyond simple if-this-then-that:

  • Classify — Read the content and categorize it (urgent/routine/spam, bug/feature/question)
  • Summarize — Condense a long email, document, or thread into key points
  • Extract — Pull structured data from unstructured text (dates, amounts, names, action items)
  • Route — Send to the right person, channel, or system based on content
  • Draft — Write a response, report, or notification based on the input
  • Alert — Notify someone with context about why this matters
  • Building Your First Workflow

    The simplest useful automation chains one trigger to one action:

    TRIGGER: New support email arrives
      → ACTION: Classify as urgent/routine/spam
      → ACTION: If urgent, post to #support-urgent Slack channel

    This three-step workflow replaces a human scanning every email, deciding its priority, and manually posting alerts. It runs in seconds instead of minutes and never misses an urgent email at 2am.

    Chaining Actions

    Real workflows chain multiple actions together. Each action's output feeds the next:

    TRIGGER: New document uploaded
      → Classify document type (invoice, contract, report)
      → Extract key fields based on type
      → Summarize the document in 3 sentences
      → Route summary to the right Slack channel
      → If invoice, add to expense tracking spreadsheet

    The key principle: each action should do one thing well. Don't build a single action that classifies AND extracts AND summarizes. Break it into steps. This makes workflows easier to debug, test, and modify.

    Error Handling

    What happens when an action fails? Good automations handle three scenarios:

  • Retry — Transient failures (API timeout, rate limit) get retried automatically
  • Fallback — If AI classification confidence is below 70%, route to a human
  • Alert — If the workflow itself breaks, notify you immediately
  • Never build an automation that fails silently. If you wouldn't notice a failure for hours, your automation isn't production-ready.

    This is chapter 2 of AI Automation Without Code.

    Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.

    View course details