Let \(\mathscr {A}\) and \(\mathscr {B}\) be two algebras, and let \(\sigma , \tau :\mathscr {A} \rightarrow \mathscr {B}\) be two linear mappings. A linear mapping \(d_1:\mathscr {A} \rightarrow \mathscr {B}\) is called a \((\sigma , \tau )\) -ternary derivation if there exist the linear mappings \(d_2, d_3:\mathscr {A} \rightarrow \mathscr {B}\) which satisfy \(d_1(ab) = d_2(a) \sigma (b) + \tau (a)d_3(b)\) for all \(a, b \in \mathscr {A}\) . By a \((d_2, \sigma , \tau , d_3)\) -derivation, we mean a \((\sigma , \tau )\) -ternary derivation \(d_1\) associated with the mappings \(d_2\) and \(d_3\) . The main purpose of this article is to study the characterization and automatic continuity of such derivations on Banach algebras and \(C^{*}\) -algebras.