Delivering the message: Instrument lifecycle

February 29, 2024

Once the user presses the send button in the August Schools application, the content of that message is delivered to all participants on the thread.

Each delivery is handled separately and completed using an appropriate category of instrument. In the case of failure or unavailability of the preferred instruments, other classes of instruments may be used to complete the delivery.

Instrument selection

The first step is selection of the type or “class" of instrument we should use to deliver the message to the recipient. This depends both on the kind of recipient and message we’re delivering. This control is configurable in each environment, but we grid out the most common setup below.

We’ll discuss the logic that controls the selection within each category of instrument in future posts.

Provisioning

After we select the preferred class of instrument to use for the delivery, we may need to provision a new instance of that instrument.

If the category has never been used before in that environment, we must register with the relevant external provider and generate any cloud resources required to send and receive messages.

Similarly, if none of the existing instances of that class of instrument can deliver the given message to the given contact, we will provision additional instances of that class of instrument on demand.

Failing outward

If none of the existing instances of the preferred class of instrument can deliver the given message, and no more instances can be provisioned, we continue to the next class of instrument by order of preference. We repeat the same loop to locate a suitable instance of the new class of instrument or otherwise attempt to provision.

If we exhaust the list of valid instruments for a delivery and still fail to locate or provision a suitable instrument, the delivery is marked as failure.