Automation & AIModule 2: Automation building blocksLesson 7 of 15
Course progress40%

17 min lesson · Updated August 2026

What are triggers, conditions and actions?

A trigger starts a workflow, conditions decide which path applies, actions change or send information, and stop, retry and exception rules keep the process bounded.

What you will learn

By the end, you will understand:

  • Map trigger, condition and action logic
  • Design validation, branching and idempotency
  • Create explicit retry, failure and stop behavior

Visual explainer

See the idea clearly.

The core building blocks

PartMeaning
TriggerThe event or schedule that starts a workflow, such as a form submission or daily time.
ConditionA true/false or multi-value decision that selects a path.
ActionAn operation such as create, update, send, calculate or notify.
StateStored facts about what has happened and what remains.
Stop/exceptionA defined end or human route when requirements are not met.

Validate before branching

Check required fields, type, format, authorization, duplicate status and business rules before taking action. Frontend validation improves experience but server-side validation remains necessary.

Treat external payloads as untrusted. A field saying “approved=true” is not approval unless the trusted system and identity establish it.

Conditions should be explicit

  1. 01

    Receive event

  2. 02

    Authenticate source

  3. 03

    Validate payload

  4. 04

    Check duplicate/idempotency key

  5. 05

    Evaluate business conditions

  6. 06

    Execute allowed action

  7. 07

    Verify response

  8. 08

    Record status

  9. 09

    Notify or escalate

Idempotency prevents duplicate effects

Networks retry and users double-submit. An idempotent design recognizes the same event and avoids charging, creating or sending twice. Use stable event IDs or safe upsert logic where supported.

Not every operation is naturally idempotent. Design duplicate checks and reconciliation for payments, messages and record creation.

Retries need limits

FailureResponse
Temporary timeout/rate limitRetry with bounded backoff and jitter where appropriate.
Invalid dataDo not retry unchanged input; send to correction path.
Permission deniedStop and alert owner; do not repeatedly attack the system.
Unknown partial successCheck external state before retry to avoid duplicate action.
Permanent service removalDisable workflow and activate fallback/migration.

Design the unhappy path first

  • Missing field
  • Duplicate event
  • Out-of-order event
  • Service unavailable
  • Credential expired
  • Rate limited
  • Action partially succeeded
  • Notification failed
  • Human unavailable
  • Cancellation received
  • Maximum retries reached
  • Manual replay procedure

Real-world example

Example: safe contact-form workflow

Example

A signed server event validates the email and consent state, checks the submission ID, creates one CRM record and sends one acknowledgement. Invalid data enters a review queue; temporary CRM failure retries; repeated IDs do not send another email.

Try this

Draw an unhappy-path flow

Map one workflow with its normal path, three invalid inputs, two system failures, duplicate event and cancellation. Write exactly where it stops, retries or asks a person.

Common questions

Questions beginners ask.

What is a trigger?

The event or schedule that starts a workflow.

What is a condition?

Logic that decides which branch applies based on validated information.

What is an action?

A scoped operation such as creating, updating, sending or notifying.

What is idempotency?

Design that lets the same request/event be handled repeatedly without creating unintended duplicate effects.

Should every failure retry?

No. Invalid data and permission errors require correction or escalation, not repeated unchanged attempts.

What is exponential backoff?

Increasing delay between retries, often with random jitter, to reduce load during temporary failure.

Why verify an action response?

A request being sent does not prove the external system completed the intended change.

What is a dead-letter or exception queue?

A holding path for failed events that require inspection, correction or controlled replay.

Assessment

Check what you understood.

5 questions · instant explanations

1. What starts a workflow?
2. What does idempotency prevent?
3. Which failure should not retry unchanged?
4. What must happen before an external action?
5. True or false: sending an API request proves the action succeeded.

Sources

Primary references.