  Algorithms play a crucial role in many technological systems that control or
affect various aspects of our lives. As a result, providing explanations for
their decisions to address the needs of users and organisations is increasingly
expected by laws, regulations, codes of conduct, and the public. However, as
laws and regulations do not prescribe how to meet such expectations,
organisations are often left to devise their own approaches to explainability,
inevitably increasing the cost of compliance and good governance. Hence, we
envision Explainability-by-Design, a holistic methodology characterised by
proactive measures to include explanation capability in the design of
decision-making systems. The methodology consists of three phases: (A)
Explanation Requirement Analysis, (B) Explanation Technical Design, and (C)
Explanation Validation. This paper describes phase (B), a technical workflow to
implement explanation capability from requirements elicited by domain experts
for a specific application context. Outputs of this phase are a set of
configurations, allowing a reusable explanation service to exploit logs
provided by the target application to create provenance traces of the
application's decisions. The provenance then can be queried to extract relevant
data points, which can be used in explanation plans to construct explanations
personalised to their consumers. Following the workflow, organisations can
design their decision-making systems to produce explanations that meet the
specified requirements. To facilitate the process, we present a software
architecture with reusable components to incorporate the resulting explanation
capability into an application. Finally, we applied the workflow to two
application scenarios and measured the associated development costs. It was
shown that the approach is tractable in terms of development time, which can be
as low as two hours per sentence.
