Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Agents gonna agent Deterministic orchestration for systems we can’t predict Eric Johnson Developer Advocate @edjgeek

Slide 3

Slide 3 text

Who am I? • Principal Developer Advocate • Serverless nerd • 35+ years software architect • Father of 5

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

The challenge What are we working back from?

Slide 6

Slide 6 text

A buddy runs a disaster relief organization He can: • Evaluate the scope • Estimate affected populations • Calculate resources • Coordinate a response. He is so good that: • FEMA calls him • The Red Cross calls him • The Salvation Army calls him • He is genuinely one of a kind He does it all … on a legal pad

Slide 7

Slide 7 text

The bus factor What happens if my friend gets hit by a bus?

Slide 8

Slide 8 text

So, I built a system Multiple agents working together the way he works • Triage • Assess • Plan • Assign The AI was easy! Building a reliable system we could trust was less easy

Slide 9

Slide 9 text

Pop quiz You have an Ai agent running a 10-step workflow. Each step is 85% accurate. What’s the overall success rate?

Slide 10

Slide 10 text

20% 0.85 = 0.197 10 Four out of five runs fail somewhere in the chain - Lussar’s law

Slide 11

Slide 11 text

40% Of multi-agent pilots fail within six months of production - Gartner

Slide 12

Slide 12 text

It’s not the agents Agent A Does its job correctly. Produces the right output for its context. Checks out. ✅ Agent B Also does its job correctly. Handles its task as designed. Also checks out. ✅ The system Agent A finishes before B expects. Output format mismatches. Both write the same resource simultaneously. Classic distributed system failure. ❌ No single agent is wrong. The system is wrong. Race conditions, state drift, missing contracts at component boundaries. We've been here before. !

Slide 13

Slide 13 text

The implicit contracts Every handoff between agents is what I call an implicit contract. The timeout the calling agent assumes. The output format the receiving agent expects. What "success" means. What happens on failure. ⏱ Timeout? How long does the sender wait before assuming failure? 📄 Format? What schema does the receiver expect to parse? ✅ Success? What does a successful response even look like? 🔁 Retry? On failure, who retries — and from where? None of it is written down. It lives in the prompts — if it lives anywhere at all. This is exactly how distributed systems fail quietly. Not with a bang. With a mismatch nobody anticipated.

Slide 14

Slide 14 text

The wrong fixes ❌ Better Prompts More instructions, more examples, more constraints in the system message. Taken to truly remarkable extremes. But better prompts don't fix timing bugs. ❌ Bigger Models If the agent made the wrong call, clearly it wasn't smart enough. But bigger models don't fix state drift. ❌ Retry Loops Just run it again until it works. But retry loops without checkpoints re- run completed work and compound errors. These fixes address the agents. The problem is between the agents.

Slide 15

Slide 15 text

The right fix = orchestration Deterministic orchestration for systems we can’t predict

Slide 16

Slide 16 text

Durable orchestration landscape Azure Durable Functions Replays orchestrator against event history in Azure Storage Restate Replays from a durable execution journal of completed operations Temporal Open-source, replays workflow code against a persistent event history Ingest Re-executes functions with step-based memoization, returning cached results for completed steps AWS Lambda durable functions Re-executes functions with step-based memoization, returning cached results for completed steps

Slide 17

Slide 17 text

Benefits of durable functions The step A unit of work that runs exactly once and creates a checkpoint when it completes The checkpoint The results of a completed step, stored for replay The replay Resume from where you left off, skip completed work

Slide 18

Slide 18 text

STEP STEP STEP STEP The replay Checkpoints Geocode Resources Planner Triage

Slide 19

Slide 19 text

STEP STEP STEP STEP The replay Checkpoints Geocode Resources Planner Triage

Slide 20

Slide 20 text

STEP STEP STEP STEP The replay Checkpoints Geocode Resources Planner Triage ⏱

Slide 21

Slide 21 text

STEP STEP STEP STEP The replay Checkpoints Geocode Resources Planner Triage ⏱

Slide 22

Slide 22 text

STEP STEP STEP STEP The replay Checkpoints Geocode Resources Planner Triage

Slide 23

Slide 23 text

STEP STEP STEP STEP The replay Geocode Resources Planner Triage Checkpoints

Slide 24

Slide 24 text

STEP STEP STEP STEP The replay Checkpoints Geocode Resources Planner Triage ✅ ✅ Triage results

Slide 25

Slide 25 text

STEP STEP STEP STEP Checkpoints Geocode Resources Planner Triage ✅ ✅ Triage results The replay

Slide 26

Slide 26 text

STEP STEP STEP STEP The replay Checkpoints ✅ Triage results ✅ Geocode results Geocode Resources Planner Triage ✅ ✅

Slide 27

Slide 27 text

STEP STEP STEP STEP The replay Checkpoints ✅ Triage results ✅ Geocode results Geocode Resources Planner Triage ✅ ✅

Slide 28

Slide 28 text

STEP STEP STEP STEP The replay Checkpoints ✅ Triage results ✅ Geocode results Geocode Resources Planner Triage ✅ ✅

Slide 29

Slide 29 text

STEP STEP STEP STEP The replay Checkpoints ✅ Triage results ✅ Geocode results Geocode Resources Planner Triage ✅ ✅

Slide 30

Slide 30 text

STEP STEP STEP STEP The replay Checkpoints ✅ Triage results ✅ Geocode results Geocode Resources Planner Triage ✅ ✅

Slide 31

Slide 31 text

STEP STEP STEP STEP The replay Geocode Resources Planner Triage ✅ ✅ Checkpoints ✅ Triage results ✅ Geocode results

Slide 32

Slide 32 text

STEP STEP STEP STEP The replay Geocode Resources Planner Triage ✅ ✅ ✅ Checkpoints ✅ Triage results ✅ Geocode results ✅ Resources results

Slide 33

Slide 33 text

STEP STEP STEP STEP The replay Geocode Resources Planner Triage ✅ ✅ ✅ Checkpoints ✅ Triage results ✅ Geocode results ✅ Resources results

Slide 34

Slide 34 text

STEP STEP STEP STEP The replay Geocode Resources Planner Triage ✅ ✅ ✅ ✅ Checkpoints ✅ Triage results ✅ Geocode results ✅ Resources results ✅ Planner results

Slide 35

Slide 35 text

STEP STEP STEP STEP The replay Checkpoints ✅ Triage results ✅ Geocode results ✅ Resources results ✅ Planner results Geocode Resources Planner Triage ✅ ✅ ✅ ✅

Slide 36

Slide 36 text

The handler() @durable_execution def handler(event: dict, context: DurableContext) -> dict: triage = context.invoke(arns["triage"], name="triage") results = context.parallel([weather, population]) w, p = results.get_results() context.step(step_push(incident_id, "done")) return {"status": "COMPLETE"}

Slide 37

Slide 37 text

The step() def step_push(step_ctx: StepContext, incident_id: str, phase: str) -> None: _push(incident_id, phase) context.step(step_push(incident_id, "triage"))

Slide 38

Slide 38 text

The parallel() def weather(ctx): return ctx.invoke(arns["weather"], name="weather") def population(ctx): return ctx.invoke(arns["population"], name="population") results = context.parallel([weather, population]) w, p = results.get_results()

Slide 39

Slide 39 text

The waitForCallback() def notify(callback_id: str, ctx): _push(incident_id, "clarify", callbackId=callback_id) result = context.wait_for_callback( submitter=notify, name="clarify", )

Slide 40

Slide 40 text

AId AI driven disaster response planning

Slide 41

Slide 41 text

The process Triage Geocode Weather Population History Resources Damage estimate Planner LogisAc Communication

Slide 42

Slide 42 text

Agent vs Tool Triage Geocode Weather Population History Resources Damage estimate Planner Logistic Communication Tools Agents

Slide 43

Slide 43 text

Agent vs Tool Triage Geocode Weather Population History Resources Damage estimate Planner LogisAc Communication Tools Agents

Slide 44

Slide 44 text

Agent vs Tool Triage Geocode Weather PopulaAon History Resources Damage estimate Planner LogisAc Communication Tools Agents Pro tip: Tools over agents whenever possible

Slide 45

Slide 45 text

Easy or hard? Triage History Damage esAmate Planner Logistic CommunicaAon Hard Easy

Slide 46

Slide 46 text

Easy or hard? Triage History Damage estimate Planner LogisAc Communication Hard Easy

Slide 47

Slide 47 text

Easy or hard? Triage History Damage estimate Planner Logistic Communication Hard Easy Pro )p: Don’t overpower or overpay on your models Nova Pro Sonnet 4.6

Slide 48

Slide 48 text

The process in order Triage Geocode Weather Population History Resources Damage estimate Planner Logistic Communication … kinda

Slide 49

Slide 49 text

The process in order … actually Geocode Weather Population History Resources Damage estimate Planner Logistic CommunicaAon Triage

Slide 50

Slide 50 text

Parallel processing Geocode Weather Population History Resources Damage esAmate Planner Logistic CommunicaAon Triage Pro tip: run in parallel whenever possible

Slide 51

Slide 51 text

Optional clarify Geocode Weather Population History Resources Damage estimate Planner Logistic Communication Triage Pause everything Including billing Pausing code

Slide 52

Slide 52 text

Pausing code Optional clarify Geocode Weather PopulaAon History Resources Damage esAmate Planner Logistic Communication Triage Pause everything Including billing Pro tip: Don’t pay for idle time

Slide 53

Slide 53 text

Let’s see it in ac7on

Slide 54

Slide 54 text

Optional clarify Geocode Weather Population History Resources Damage estimate Planner Logistic Communication Triage What just happened

Slide 55

Slide 55 text

OpAonal clarify Geocode Weather PopulaAon History Resources Damage estimate Planner LogisAc Communication Triage Remember those implicit contracts User fails to respond Geocode service returns an error Planner service model is throttled Configured timeout Configured retries Configured retries with backoff

Slide 56

Slide 56 text

The cost $0.003 $0.006 $0.053 $0.001 $0.001 $0.001 LAMBDA BEDROCK NOVA BEDROCK SONNET APPSYNC DYNAMODB API GATEWAY $0.063 per incident • 100 incidents/month= $6.30 • 1,000 inc/month = $63 • 10,000 inc/month = $630 Swapping Planner/Logis;cs/Comms to Nova Pro would cut per-incident cost from $0.063 to roughly $0.015 At the expense of output quality.

Slide 57

Slide 57 text

The wrap

Slide 58

Slide 58 text

What this architecture gives you • Parallelism: Independent agents ran concurrently, cutting wall-clock time • Recovery: Any failure replays from the last checkpoint. No work is lost or duplicated. The system self-heals from exactly where it stopped. • Timeout Contracts: Every wait is explicit, bounded, and handled by the infrastructure. No surprise hangs. No mystery timeouts buried in prompts. • Exactly-Once Execution: Each step runs once and checkpoints its result. Retries and replays never duplicate side effects. Idempotency, by construction.

Slide 59

Slide 59 text

Three things to walk away with Tool or agent? Before every step, ask this question. If the answer is deterministic, write a function. Spend non- determinism deliberately — only where reasoning actually earns its keep. Design for twice Design every step as if it will run twice. Idempotency isn't optional in a durable system. If your step has a side effect and you haven't thought about replay, you haven't finished the design. Name the contract At every agent boundary consider timeout, format, and success definition. If it lives only in a prompt, it's implicit. Move it to the orchestration layer. These three questions catch the majority of failure modes before you ship.

Slide 60

Slide 60 text

Resources s12d.com/goto26

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

Thank you! @edjgeek