Declarative workflow contract for Squid Mesh workflow modules.
Example
defmodule Billing.InvoiceReminder do
use SquidMesh.Workflow
workflow do
trigger :invoice_delivery do
manual()
payload do
field :account_id, :string
field :invoice_id, :string
end
end
step :load_invoice, Billing.Steps.LoadInvoice
step :send_email, Billing.Steps.SendReminderEmail, retry: [max_attempts: 3]
transition :load_invoice, on: :ok, to: :send_email
end
endThe contract defined here captures workflow structure. Validation and runtime execution behavior are added in subsequent slices.
Summary
Functions
Declares a first-class approval step for manual review decisions.
Declares a cron-based trigger.
Declares one payload field inside a trigger payload block.
Declares a manual trigger.
Declares a manual review step as an alias of approval_step/2.
Declares the payload contract for the current trigger.
Declares one workflow step.
Declares a transition from one step outcome to the next step.
Declares a named workflow trigger.
Declares the workflow body.
Functions
Declares a first-class approval step for manual review decisions.
Declares a cron-based trigger.
Declares one payload field inside a trigger payload block.
Declares a manual trigger.
Declares a manual review step as an alias of approval_step/2.
Declares the payload contract for the current trigger.
Declares one workflow step.
Declares a transition from one step outcome to the next step.
Declares a named workflow trigger.
Declares the workflow body.