CYGURUACADEMYMy learning ↗
AI & Automation / MODULE 7 / LESSON 1 OF 5

Map an event-driven workflow and its states

10 min read · 1967 words · practice time separate

Extended edition · 7 November 2026

Reading estimate uses 200 words per minute and excludes exercises, self-review and optional book descriptions. Earlier lesson checks are kept; revisit the expanded text if you completed the short edition.

BY THE END OF THIS LESSON

Map an event-driven workshop-update workflow with clear component ownership, interface contracts, state evidence and routes for delayed or duplicate messages.

This module moves from a business-process blueprint to component architecture: which part receives a fact, which part owns a record, what crosses each interface and how the whole process can be reconstructed. The fictional case is a workshop update desk that prepares a private review packet from approved course notes. No notifications are sent and no services are connected. You will map an event-driven design without assuming that an event automatically authorises an action, arrives only once or makes every component agree immediately about the current state.

In this lesson · 12 sections
  1. Define the system boundary and its useful result
  2. Separate producers, channels and consumers
  3. Design the event envelope and its limits
  4. Give intake one clear responsibility
  5. Assign one owner for workflow state
  6. Split deterministic validation from drafting
  7. Map the interfaces between components
  8. Handle duplicates and out-of-order events
  9. Give each failure an architectural destination
  10. Trace one request across the whole map
  11. Challenge the architecture with a delayed update
  12. Deliver the event and component map

1. Define the system boundary and its useful result

The workshop update desk receives approved changes to course information and prepares an inspectable packet for an editor. Its useful result is a reviewed internal draft, not a published course listing or a message to learners. Write that boundary at the top of the architecture. A component diagram should not make external consequences disappear behind a box called delivery. Each proposed action must have an explicit meaning.

Identify what lies outside the system: the source owner's decision to approve course facts, the editor's final publication process and any enrolment or payment service. The architecture may reference those responsibilities without claiming to own them. This is important because a workflow can quietly expand when a convenient input mentions another action. An approved note saying a date changed supplies evidence for a draft; it does not necessarily authorise rescheduling every attendee. Keep the desk's result narrow enough that you can trace the information and authority needed to produce it.

2. Separate producers, channels and consumers

An event producer records or announces a relevant occurrence. A channel carries the event. A consumer receives it and performs its defined responsibility. Microsoft's architecture guidance describes these general roles; the desk design here is an original classroom application. The pattern does not require a particular cloud product, and a small system may not need a complex broker to satisfy its actual workload.

For the paper map, the source approval register produces a note-approved event. An intake component receives the event through the chosen channel. A packet builder consumes a validated request and creates a draft artefact. A review component presents the packet to an editor. Name each responsibility rather than drawing one AI box between input and output. The language model may help draft a summary inside the builder, but it should not own receipt, permission checks, durable state or every other function simply because the finished result contains text.

3. Design the event envelope and its limits

The fictional event envelope contains event identifier, event type, producer identifier, source record identifier, source version and observed time. It also contains a reference to the approved task scope. These fields help the receiver identify what was reported and locate the relevant evidence. They are a proposed classroom contract, not a statement that any named service already supports them.

An envelope is not the whole source record and is not proof that all facts are current. The receiver may need to retrieve the authorised version through a permitted path before drafting. Also distinguish event time, receipt time and processing time. A delayed event can arrive after a newer source update. Choosing the latest arrival as truth would confuse transport order with business order. Record which source version the task should use and how conflicts are resolved. Do not assume a global clock or perfect ordering where the implementation has not established those properties.

4. Give intake one clear responsibility

The intake boundary checks that the event belongs to a supported type and authorised producer context, that required fields are present and that the event can be associated with the intended task. It records receipt and routes malformed or out-of-scope messages appropriately. It should not generate a polished summary before establishing what source and scope the message concerns.

Receipt is not business completion. A channel acknowledgement may show that a message was accepted for handling, while the desk still needs validation, drafting and review. Define what the acknowledgement means in the proposed contract. If an interface replies accepted, the caller should know whether that means received, queued or finished. Ambiguous success words are an architectural defect because they let different components make incompatible assumptions. The classroom map should show the intake receipt separately from the final reviewed-packet evidence, even if the same person performs both steps during the exercise.

5. Assign one owner for workflow state

A state-owning component maintains the task record and the allowed transitions. The record links request, source version, current state, draft version, unresolved issues and evidence references. Other components can propose changes through defined interfaces, but they should not each maintain a competing private idea of which draft is current. Decide which record a reviewer would inspect to understand the task's actual progress.

This does not prescribe a particular database or guarantee consistency merely because the diagram labels one owner. A real implementation needs appropriate durability and concurrency controls for the chosen design. State ownership is an architectural requirement that makes those questions explicit. If two consumers both decide a task is ready and create incompatible drafts, the map should identify how competing updates are rejected, reconciled or versioned. A model's conversation memory cannot substitute for that coordination. The task record is the system's inspectable process evidence, not a narrative the model may rewrite to match its latest output.

6. Split deterministic validation from drafting

The validator checks structural and task rules: supported event type, required source reference, allowed state and any deterministic consistency conditions. The draft worker receives only a validated, scoped request and approved material needed for its language task. This boundary makes it easier to examine what the model was asked to do and prevents validation from disappearing into an instruction to be careful.

For the workshop desk, the worker can summarise the approved date change, but it should not choose which source version is authoritative or infer permission to publish. Those decisions belong to specified rules and roles. The worker returns a candidate draft with source links and unresolved items, not an instruction that every downstream component must obey. Treat its output as data subject to validation and review. A coherent architecture gives language generation a useful bounded role while preserving the surrounding decisions that make the result operationally meaningful.

7. Map the interfaces between components

For every arrow, name the message, sender, receiver, required fields and expected response. The intake-to-state-owner interface might create or locate a scoped request. The state-owner-to-builder interface might request a draft for source version P2. The builder-to-review interface might return candidate D3 with its source basis. These are different contracts, not interchangeable blobs of text.

Write what the receiver is allowed to assume. A builder should not assume that an event's free-text description contains an authorised recipient list. A reviewer should not assume that a structurally valid candidate has passed factual checks. Also identify which fields are references and which contain actual content. This matters for access and size as well as meaning. A component interface is useful when it reduces the amount of hidden knowledge needed to process a message. If the receiver must infer the task from a previous conversation, the arrow has not yet been specified adequately.

8. Handle duplicates and out-of-order events

A repeated note-approved event should lead to the existing intended task where the business contract says it is the same work. That behaviour requires an enforceable identity and coordination rule, not merely a repeated phrase in the prompt. Separate event identity from the logical task and from individual processing attempts. One event may be redelivered without creating a new approved intention.

Now introduce an older source-version event arriving after P2 is already in review. The receiver should apply the documented source-version rule rather than overwrite the current basis because the event arrived later. A valid older event can be retained as history while being unsuitable to advance the current task. If the business meaning is unclear, route it to the source owner. The architecture should not claim all events are totally ordered or that timestamps automatically resolve every conflict. It should state what is known, which record owns the decision and what evidence supports a transition.

9. Give each failure an architectural destination

Malformed envelopes go to an intake correction route. Missing authorised source material goes to clarification. A draft-worker failure can be recorded and retried only under its defined rules. A rejected draft returns with the editor's issue. A hypothetical unknown external save outcome goes to reconciliation rather than being relabelled as failed. Naming the destinations prevents a generic error queue from hiding different remedies.

Each route needs an owner and enough context to act. A message saying something went wrong is less useful than one identifying request R31, source P2 and the missing field or evidence. Avoid copying unrelated private content into every error record. The architecture should retain the minimum relevant evidence for diagnosis and accountability under its retention policy. A failure path is part of the system's useful behaviour: it keeps incomplete work inspectable instead of forcing every component to fabricate a success response so the next arrow can continue.

10. Trace one request across the whole map

Use fictional request R31 arising from approval event E12 for source P2. Intake records receipt, validates the envelope and associates R31 with P2. The state owner marks it ready under the rule. The draft worker produces D3 from the approved packet. The review component presents D3 and source links, and the editor accepts it as an internal packet. The completion record identifies the accepted version and scope.

At every step, name the evidence passed forward and the assumptions that do not pass. Receipt does not become approval. Validation does not become factual truth. A candidate draft does not become a command to publish. This trace is more informative than a diagram whose arrows are all labelled process. It also reveals where an interface may need another field or a clearer response. The exercise is successful when another learner can follow the request without filling the gaps with imagined services, hidden authority or a model that supposedly knows what every component intended.

11. Challenge the architecture with a delayed update

After D3 reaches review, introduce source P3 with a changed date. The new event does not silently rewrite the draft the editor is currently inspecting. The state owner applies the stale-version rule, records the new basis and routes the task for the required reassessment. Preserve D3 and its history while identifying the newer proposed work separately.

Now deliver the earlier E12 again. It should not restore P2 as current or create an unreviewed duplicate task under the same intention. Describe which identity and version checks support that behaviour and what remains a requirement for implementation. This challenge tests the architecture's component boundaries rather than merely the model's writing quality. A strong design can explain why an older message is valid history yet unable to advance current work. It can also name the unresolved case where no authorised precedence rule exists, leaving a human owner to clarify instead of inventing a convenient order.

12. Deliver the event and component map

Your artefact contains system boundary, producer and consumer roles, channel meaning, envelope fields, state owner, component interfaces, normal trace and failure routes. Mark implementation assumptions that still need verification: durability, concurrency, access enforcement and message-delivery behaviour. The architecture is a proposal for review, not evidence that these properties already hold in software.

Finish by asking what happens if any single arrow is delayed, duplicated or missing required information. If the answer is simply that AI will handle it, replace that claim with a state, owner and evidence requirement. The next lesson chooses deterministic rules or a model for each responsibility more deliberately. Keep this component map nearby. It provides the boundaries within which that choice can be made, preventing a language-generation capability from absorbing duties such as arithmetic, permission enforcement or durable coordination that require different mechanisms and different evidence.

A worked example

Fictional E12 reports approval of source P2 for request R31. Intake records receipt, the state owner validates readiness, the builder returns D3 and an editor accepts the internal packet. A later P3 update makes the older basis subject to reassessment; a delayed duplicate E12 must not silently restore P2 or create another unintended task.

Put it into practice

Draw the workshop desk architecture with producer, channel, intake, state owner, validator, draft worker and review boundary. Label each interface and response meaning. Trace R31 normally, then introduce an out-of-order source event and duplicate delivery. Name the evidence, owner and implementation requirements at each route.

Notes stay in this browser. Avoid sensitive personal information.

Compare your answer · Self-review guide

A strong map separates event receipt, task state, language drafting and human acceptance. Interfaces identify fields and assumptions, one record owns current workflow state and delayed or duplicate events follow explicit identity and version rules. The diagram does not claim a model or a label supplies durable enforcement or proves live completion.

This is an indicative answer, not an automatic assessment of your written work. Check your reasoning, units and assumptions.

CHECK YOUR UNDERSTANDING

What does an intake acknowledgement establish under a clearly defined event contract?

← PreviousNext lesson →