Lesson 2 of 7
Lesson 2 — Triggers, Actions and Conditions
Build workflows that make decisions: if this, then that, else something else, with loops and delays.
Learn it
Every workflow has at least one trigger and one action. Between them you can add conditions, loops and delays.
A condition asks a yes/no question: is the email from a teacher? Is the file larger than 10 MB? If yes, do one thing; if no, do another.
A loop repeats an action for every item in a list: every row in a spreadsheet, every attachment, every alert.
A delay pauses the workflow until a set time or until something else happens — useful for reminders and approvals.
Key terms
- Condition
- A yes/no decision in a workflow.
- Branch
- A different path the workflow takes depending on a condition.
- Loop
- Repeating a set of actions for each item in a list.
- Delay
- A pause in a workflow.
- Boolean logic
- Using AND, OR and NOT to combine true/false values.
A smart homework hand-in workflow
Students upload files to a folder.
- 1Trigger: A new file appears in the hand-in folder.
- 2Condition 1: Is the filename format correct? If no, reply with instructions.
- 3Condition 2: Is it before the deadline? If yes, confirm receipt. If no, mark as late.
- 4Loop: For every late file, add the student's name to a late list.
- 5Result: Teacher has a sorted, timestamped list without manual checking.
Pseudo-code for the hand-in workflow
textWHEN new_file_uploaded:
IF filename matches 'Surname_Firstname_Assignment.ext':
IF uploaded_before_deadline:
SEND 'Received on time.'
ADD name to 'on_time_list'
ELSE:
SEND 'Received late.'
ADD name to 'late_list'
ELSE:
SEND 'Please rename your file to Surname_Firstname_Assignment.ext'
STOPTrigger, two nested conditions, two branches, a loop hidden inside 'ADD name to list' and a stop path.
Try it
Complete the condition that sends a reminder only if rain is forecast.
IF weather.forecast == ______
SEND 'Bring an umbrella!'
ELSE
SEND 'No rain today.'Challenge
Design a workflow for a school library: when a book is returned late, email the student, add a fine to their record, and once a week email a summary to the librarian. Draw it as trigger → condition(s) → action(s) → loop/delay.
Pick whichever way suits you — every mode earns the same bonus XP.
Write at least 40 more characters to submit.
Mark your own work
Guided walkthrough — 0/3 clues revealed
- Clue 1 locked — reveal it only if you get stuck.
- Clue 2 locked — reveal it only if you get stuck.
- Clue 3 locked — reveal it only if you get stuck.
Each clue costs 4 XP (never below 18 XP). You'd earn 35 XP right now.