Track 04 · Multi-agent & integrationLesson 08 of 11
Agents started by events and schedules
Begin work from business events, not from someone opening a chat.
- Lesson library · reference
- 35 min read
- 60 min hands-on
- Pro
What you'll be able to do
01- Identify the trigger sources in a customer's estate (events, webhooks, CDC, queues, schedules, file drops, email) and choose one per use case.
- Design an event envelope with stable IDs, a business key and a version, using CloudEvents attributes where they fit.
- Implement an idempotent consumer for at-least-once delivery, with bounded retries and a dead-letter queue.
- Design ordering, fan-out and debouncing so a burst of correlated events starts the right amount of agent work, once.
- Avoid the scheduling pitfalls (time zones, overlapping runs, catch-up after an outage) and hand work to a durable workflow safely.
- Defend which inputs may start an agent at all, in front of a security reviewer.
Before you start
- Workflows that survive restarts: what happens after the trigger. The workflow ID as deduplication key is introduced there.
- SaaS connectors and auth flows: webhook signature verification and replay protection. Not repeated here.
- A gateway for bursty agent traffic: backpressure and fleet-wide limits once triggered work hits upstream systems.
- Retries, fallbacks and failing gracefully: retry classification and dead-letter queues inside the agent.
The short version
In production, agents rarely start because a person typed into a chat window. They start because something happened: SAP marked a container as delayed, a ServiceNow incident was reassigned, a customs file landed in an SFTP folder, or a schedule said "every 15 minutes, re-check open exceptions". The trigger layer turns those signals into agent work, and it has to do so exactly once in effect, even though almost every delivery mechanism delivers at least once, sometimes out of order, sometimes in bursts of hundreds. So you design an event envelope with a stable ID and a business key, make every consumer idempotent, bound retries and park poison messages in a dead-letter queue, keep ordering only where the business needs it, group correlated bursts before they fan out, run schedules with explicit time zones and overlap policies, and hand each unit of work to a durable workflow whose ID makes duplicates impossible. And you decide, in writing, what is never allowed to trigger an agent.
Key takeaways:
- Assume at-least-once delivery everywhere. Idempotency is the consumer's job.
- The deduplication key is the event's identity (source plus ID), and the workflow ID is the business identity. You need both.
- Order per business key, not globally. Global ordering is expensive and rarely needed.
- Debounce correlated bursts: one vessel re-sequence should start one batch, not 180 crews.
- Every schedule needs a time zone, an overlap policy and a catch-up policy written down.
Pro lesson
The rest of this lesson is in Pro.
The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.
- Every stage and specialisation, in full
- Every lab and every role project
- Halden weeks 2–10, on your record
- Every drill, live in the playground
- All solutions, plus the server judge
- Lab Assistant and every Teach with AI