Uni Ecto Plugin [exclusive] May 2026

def run(attrs) do Uni.new() |> Uni.put(:original_attrs, attrs) |> add_step(:build_changeset, fn ctx -> changeset = User.registration_changeset(ctx.data.original_attrs) :ok, changeset end) |> add_step(:insert_user, insert(&1.data.build_changeset)) |> add_step(:assign_default_role, fn ctx -> user = ctx.data.insert_user updated_changeset = User.changeset(user, %role: "verified_member") :ok, updated_changeset end) |> add_step(:update_role, update(&1.data.assign_default_role)) |> add_step(:send_welcome, fn ctx -> # Imagine this calls an email service IO.inspect("Sending welcome to #ctx.data.update_role.email") :ok, %delivered: true end) |> Uni.execute() end end

def uni_broadcast_config do [ topic: fn post -> "posts:#post.id" end, only_if: fn changeset -> # Only broadcast if the status actually changed to "published" Ecto.Changeset.get_change(changeset, :status) == "published" end ] end Use code with caution. Best Practices for UniEcto Users Keep Contexts Clean uni ecto plugin

Modern applications rely on fragmented external dependencies (Stripe for payments, Twilio for SMS, PostgreSQL for data, OpenAI for AI). Integrating these often results in "vendor lock-in," messy codebases, and high switching costs. def run(attrs) do Uni

. One popular preset, "Castle Byers," is frequently used to replicate the neon-inspired titles seen in shows like Stranger Things Dual Pass Rendering . One popular preset

The plugin introduces a set of generic "Behaviors" that external services must conform to.

Uni provides Uni.on_error/2 to rescue failed steps:

A typical UNI is represented as: