Skip to main content

Model nodes

CRUD against your Eloquent models. model is always a fully-qualified class name (App\Models\Order::class). Each node validates that the class is an Eloquent model and fails otherwise.

In the interactive builder, the attributes / with groups are filled in dynamically from the chosen model — its fillable attributes and its relationship methods. In code you supply them directly.


Create record

@wf::model.create · ModelCreateNode

FieldTypeNotes
modeltextRequired.
attributesgroupAttribute → value map passed to Model::create(). Supports {{ }}.

Output: the created record's full attribute array — so {{ nodes.<id>.id }}, {{ nodes.<id>.created_at }}, etc.

['id' => 'ticket', 'type' => ModelCreateNode::type(), 'config' => [
'model' => \App\Models\Ticket::class,
'attributes' => ['subject' => '{{ trigger.subject }}', 'status' => 'open'],
]]

Update record

@wf::model.update · ModelUpdateNode

Finds one record by key = value and updates it.

FieldTypeDefaultNotes
modeltextRequired.
keytextidColumn to match on.
valuetextRequired. Supports {{ }}.
attributesgroupAttribute → value map. Supports {{ }}.

Fails if no record matches. Output: the fresh record's attribute array.


Delete record

@wf::model.delete · ModelDeleteNode

Finds one record by key = value and deletes it.

FieldTypeDefaultNotes
modeltextRequired.
keytextid
valuetextRequired.

Fails if no record matches. Output: { "model": "App\\Models\\Order", "<key>": "<value>" }


List records

@wf::model.list · ModelListNode

Queries the model, optionally filtered, ordered, eager-loaded, and limited.

FieldTypeDefaultNotes
modeltextRequired.
filtercheckboxfalseTurn on a single column condition.
fieldtext(when filter) Column to filter by.
operatorselect=(when filter) =, !=, >, >=, <, <=, like, not_like, starts_with, ends_with, in, not_in, is_null, is_not_null.
valuetext(for scalar operators) Supports {{ }}.
valuesjson(for in / not_in) JSON array. Supports {{ }}.
withgroupRelationships to eager-load.
order_bytextColumn to sort by. Blank = unordered.
order_directionselectascasc or desc.
limitnumber1000 = no limit.

Output: { "result": [ ...rows as arrays ], "count": <n> } — feed result straight into a Loop or a collection node.