@startuml
participant "Language SDK" order 10
box "Engine"
participant "Resource Monitor" order 15
participant "Step Generator" order 20
participant "Step Executor" order 25
end box
participant "Resource Provider" order 30

"Language SDK" -> "Resource Monitor" ++ : RegisterResourceRequest(type, name, inputs, options)
"Resource Monitor" -> "Step Generator" ++ : RegisterResourceEvent(type, name, inputs, options)
"Step Generator" -> "Resource Provider" ++ : CheckRequest(type, inputs, old inputs)
"Step Generator" <- "Resource Provider" -- : CheckResponse(inputs', failures)
"Step Generator" -> "Resource Provider" ++ : DiffRequest(type, inputs', old state, options)
"Step Generator" <- "Resource Provider" -- : DiffResponse(diffs)
"Step Generator" -> "Step Executor" --++ : UpdateStep(inputs', old state, options)
note left
	This is fire-and-forget on the part of the step generator.
	The step will run in parallel with steps for other resources.
end note
"Step Executor" -> "Resource Provider" ++ : UpdateRequest(type, inputs', old state)
"Step Executor" <- "Resource Provider" -- : UpdateResponse(new state)
"Resource Monitor" <- "Step Executor" -- : done(new state)
"Language SDK" <- "Resource Monitor" -- : RegisterResourceResponse(urn, ID, new state)
@enduml
