Skip to content

Database Schema

Filament Flow creates the following tables. Run php artisan migrate after installing or updating the package.

workflows

Stores one workflow definition per model class (and optionally per tenant).

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
tenant_idbigint unsignedYesForeign key to the tenant model; null for global workflows
namevarcharNoHuman-readable workflow name
model_typevarcharNoFully-qualified model class name
state_columnvarcharNoColumn on the model that holds the state value (default: state)
is_activebooleanNoWhether this workflow is active (default: true)
creation_policyjsonYesOptions for record creation, e.g. auto_assign_creator, assignment_type
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

Unique index on (tenant_id, model_type, state_column).

workflow_states

One row per state within a workflow. Both PHP-backed and database-only states are stored here.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
workflow_idbigint unsignedNoForeign key to workflows
namevarcharNoState identifier (e.g. pending, class name for PHP states)
labelvarcharNoDisplay label shown in the UI
class_namevarcharYesFully-qualified PHP State class; null for database-only states
colorvarcharNoFilament colour token (default: gray)
iconvarcharYesHeroicon identifier
descriptiontextYesOptional description shown in tooltips / infolists
sort_orderintegerNoDisplay order; lower values appear first (default: 999)
is_initialbooleanNoWhether records start in this state (default: false)
is_finalbooleanNoWhether this is a terminal state (default: false)
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

Unique index on (workflow_id, name).

workflow_transitions

Defines allowed state-to-state transitions within a workflow.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
workflow_idbigint unsignedNoForeign key to workflows
from_state_idbigint unsignedYesSource state; null means "from any state"
to_state_idbigint unsignedYesTarget state
namevarcharNoMachine-readable transition name
labelvarcharNoDisplay label for action buttons
descriptiontextYesOptional description
class_namevarcharYesFully-qualified Spatie Transition class to execute
requires_confirmationbooleanNoShow a confirmation dialog before executing (default: false)
requires_reasonbooleanNoRequire the user to provide a reason (default: false)
conditionsjsonYesAdditional condition configuration
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

Unique index on (workflow_id, from_state_id, to_state_id, name).

workflow_transition_fields

Fields displayed in the form when a transition is executed.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transition_idbigint unsignedNoForeign key to workflow_transitions
field_namevarcharNoForm field identifier
field_typevarcharNoFilament field type (e.g. text, textarea, select)
labelvarcharNoDisplay label
model_attributevarcharYesModel attribute to map the field value to
mapping_typeenumNoHow the value is applied: direct, transform, computed, relationship, assignment, custom, ignore (default: direct)
mapping_configjsonYesExtra config for the mapping strategy
is_requiredbooleanNoWhether the field is required (default: false)
validation_rulesjsonYesLaravel validation rules array
custom_validation_classvarcharYesClass implementing custom validation
sort_orderintegerNoDisplay order (default: 0)
field_configjsonYesAdditional Filament field options
save_to_modelbooleanNoWhether the value is persisted to the model (default: true)
created_attimestampYes
updated_attimestampYes

workflow_transition_permissions

Per-transition permission rules that restrict which users may execute a specific transition.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transition_idbigint unsignedNoForeign key to workflow_transitions
permission_typeenumNorole, assignment, custom
permission_valuevarcharYesRole name(s) or custom value depending on type
require_allbooleanNoIf true, all rules must pass (AND); otherwise any rule suffices (OR) (default: false)
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

workflow_transition_validation_rules

Field-level validation rules applied when a transition form is submitted.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transition_idbigint unsignedNoForeign key to workflow_transitions
field_namevarcharNoThe form field this rule applies to
rulesjsonNoLaravel validation rules array
custom_messagevarcharYesCustom validation error message
sort_orderintegerNoEvaluation order (default: 0)
created_attimestampYes
updated_attimestampYes

Unique index on (transition_id, field_name).

workflow_state_fields

Field-level visibility and mutability configuration per state.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
state_idbigint unsignedNoForeign key to workflow_states
field_namevarcharNoModel or form field identifier
visibilityenumNovisible or hidden (default: visible)
mutabilityenumNoreadonly, editable, or locked (default: editable)
is_requiredbooleanNoWhether the field is required in this state (default: false)
sort_orderintegerNoDisplay order (default: 0)
validation_rulesjsonYesState-specific validation rules
created_attimestampYes
updated_attimestampYes

Unique index on (state_id, field_name).

workflow_state_field_roles

Role-specific overrides for a workflow_state_fields entry. Allows certain roles to see or edit fields that are hidden/locked for everyone else.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
state_field_idbigint unsignedNoForeign key to workflow_state_fields
role_namevarcharNoRole name to match; also accepts virtual tokens @owner, @assigned, @assigned:type
visibilityenumYesOverride value: visible or hidden; null means no override
mutabilityenumYesOverride value: readonly, editable, or locked; null means no override
is_requiredbooleanYesOverride required flag; null means no override
created_attimestampYes
updated_attimestampYes

workflow_state_visibility

High-level visibility configuration for a state (who can see records in this state).

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
state_idbigint unsignedNoForeign key to workflow_states
visibility_typeenumNoroles, assignment, public, custom
visibility_configjsonYesType-specific configuration
allow_admin_overridebooleanNoAdmins can always see records regardless of rules (default: true)
created_attimestampYes
updated_attimestampYes

workflow_state_access_rules

Fine-grained access rule tokens for a state, evaluated by WorkflowStateAccessService.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
state_idbigint unsignedNoForeign key to workflow_states
access_typeenumNoview, edit, transition, create
rulevarcharNoRule token (same syntax as Code-First tokens: @authenticated, role:name, etc.)
operatorenumNoor (any rule passes) or and (all rules must pass) (default: or)
priorityintegerNoEvaluation priority; lower values are evaluated first (default: 0)
is_activebooleanNoWhether this rule is active (default: true)
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

workflow_assignments

Records a user's assignment to a specific model record with access override flags.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
assignable_typevarcharNoPolymorphic model class (morph type)
assignable_idbigint unsignedNoPolymorphic model ID
user_idbigint unsignedNoForeign key to users
assignment_typeenumNoprimary, secondary, viewer (default: primary)
assigned_attimestampNoWhen the assignment was created (default: current time)
assigned_bybigint unsignedYesForeign key to users; who made the assignment
metadatajsonYesArbitrary extra data
override_viewbooleanYestrue grants view access regardless of state rules; null follows state rules
override_editbooleanYestrue grants edit access regardless of state rules; null follows state rules
override_transitionbooleanYestrue grants transition access regardless of state rules; null follows state rules
created_attimestampYes
updated_attimestampYes

Unique index on (assignable_type, assignable_id, user_id, assignment_type).

workflow_notifications

Top-level notification configuration tied to a workflow event.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
workflow_idbigint unsignedNoForeign key to workflows
transition_idbigint unsignedYesScope to a specific transition (for on_transition trigger)
state_idbigint unsignedYesScope to a specific state (for on_state_enter / on_state_exit triggers)
trigger_eventenumNoon_transition, on_state_enter, on_state_exit, on_assignment, on_field_change (default: on_transition)
namevarcharNoInternal name for this notification configuration
descriptiontextYesOptional description
is_activebooleanNoWhether this notification is active (default: true)
timingenumNoimmediate or delayed (default: immediate)
delay_minutesintegerYesMinutes to delay dispatch when timing = delayed
priorityenumNolow, medium, high, urgent (default: medium)
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

workflow_notification_recipients

Defines who receives a notification. Multiple rows per notification, each describing a different recipient strategy.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
notification_idbigint unsignedNoForeign key to workflow_notifications
recipient_typeenumNorole, user, trigger_user, assigned_users, record_owner, state_actors, all_involved, involvement_type, custom_field, custom_query, custom_class (default: role)
recipient_configjsonYesType-specific configuration (e.g. {"role": "manager"})
sort_orderintegerNoProcessing order (default: 0)
created_attimestampYes
updated_attimestampYes

workflow_notification_channels

Delivery channels for a notification. Multiple channels per notification are supported.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
notification_idbigint unsignedNoForeign key to workflow_notifications
channel_typeenumNodatabase or mail (default: database)
channel_configjsonYesChannel-specific options
is_activebooleanNoWhether this channel is active (default: true)
created_attimestampYes
updated_attimestampYes

workflow_notification_templates

Message templates for a specific notification + channel combination.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
notification_idbigint unsignedNoForeign key to workflow_notifications
channel_idbigint unsignedNoForeign key to workflow_notification_channels
subjectvarcharYesEmail subject line
titletextYesNotification title (database channel)
bodytextNoMain message body
action_texttextYesCall-to-action button label
action_urltextYesCall-to-action button URL
template_engineenumNoblade, mustache, or plain (default: plain)
variablesjsonYesVariable definitions and default values
formatenumNohtml, markdown, or plain (default: html)
metadatajsonYesArbitrary extra data
created_attimestampYes
updated_attimestampYes

workflow_notification_logs

Audit log for every notification dispatch attempt.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
notification_idbigint unsignedNoForeign key to workflow_notifications
user_idbigint unsignedYesRecipient user ID
notifiable_typevarcharNoPolymorphic model class
notifiable_idbigint unsignedNoPolymorphic model ID
channelvarcharNoChannel used for delivery
statusenumNopending, sent, failed, skipped (default: pending)
error_messagetextYesError detail on failure
payloadjsonYesFull notification payload at time of dispatch
sent_attimestampYesTimestamp of successful delivery
created_attimestampYes
updated_attimestampYes

workflow_state_transitions

Audit trail for every state transition that occurs on any model.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transitionable_typevarchar(100)NoModel class (indexed)
transitionable_idbigint unsignedNoModel ID (indexed)
workflow_idbigint unsignedYesForeign key to workflows; null if workflow was deleted
transition_idbigint unsignedYesForeign key to workflow_transitions; null if deleted
from_statevarchar(150)YesState class or name before transition
to_statevarchar(150)NoState class or name after transition
from_state_labelvarchar(100)YesHuman-readable label of the source state at time of transition
to_state_labelvarchar(100)NoHuman-readable label of the target state at time of transition
user_idbigint unsignedYesUser who triggered the transition
user_namevarchar(150)YesSnapshot of user name at time of transition
user_emailvarchar(150)YesSnapshot of user email at time of transition
ip_addressvarchar(45)YesIP address of the request
user_agentvarchar(255)YesUser-agent string of the request
reasontextYesReason provided by the user
notestextYesFree-form notes captured from transition form
created_attimestampNoTransition timestamp (default: current time)
duration_secondsinteger unsignedYesTime spent in the previous state
has_metadatabooleanNoWhether a workflow_transition_metadata row exists (indexed)
has_snapshotbooleanNoWhether workflow_transition_snapshots rows exist (indexed)
is_visiblebooleanNoWhether this entry is visible in the audit UI (default: true)

workflow_transition_metadata

Extended metadata for a transition history entry. Created only when metadata is available.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transition_history_idbigint unsignedNoForeign key to workflow_state_transitions
form_datajsonYesRaw form submission data
field_changesjsonYesBefore/after values for changed fields
validation_errorsjsonYesAny validation errors encountered
rules_evaluatedjsonYesAccess rules evaluated during the transition
related_changesjsonYesChanges to related models
custom_datajsonYesArbitrary custom data from transition classes
created_attimestampYes
updated_attimestampYes

workflow_transition_snapshots

Point-in-time record snapshots taken before and/or after a transition.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transition_history_idbigint unsignedNoForeign key to workflow_state_transitions
snapshot_typeenumNobefore or after (default: after)
record_datajsonNoSerialised model attributes at snapshot time
related_datajsonYesSerialised related model data
is_compressedbooleanNoWhether record_data is compressed (default: false)
created_attimestampNoSnapshot timestamp (default: current time)

workflow_user_involvement

Tracks which users have been involved with a record and in what capacity.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
model_typevarchar(100)NoModel class
model_idbigint unsignedNoModel ID
user_idbigint unsignedNoForeign key to users
involvement_typevarcharNoType of involvement (e.g. transitioned, assigned, commented)
statevarchar(150)YesState at time of involvement
first_involved_attimestampYesTimestamp of first involvement
last_involved_attimestampYesTimestamp of most recent involvement
involvement_countinteger unsignedNoNumber of involvement events (default: 1)
created_attimestampYes
updated_attimestampYes

Unique index on (model_type, model_id, user_id, involvement_type, state).

workflow_transition_side_effects

Declarative side effects to apply to a model's attributes when a transition executes.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
transition_idbigint unsignedNoForeign key to workflow_transitions
effect_typeenumNoset_field, set_timestamp, clear_field, increment, custom_class
field_namevarcharNoModel attribute to modify
value_expressionvarcharYesValue or expression to apply (depends on effect_type)
sort_orderintegerNoExecution order (default: 0)
is_activebooleanNoWhether this effect is active (default: true)
created_attimestampYes
updated_attimestampYes

workflow_scheduled_checks

Time-based checks that evaluate conditions on records and fire notifications, transitions, or side effects.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
workflow_idbigint unsignedNoForeign key to workflows
namevarcharNoInternal name for this check
descriptiontextYesOptional description
state_idbigint unsignedYesRestrict check to records in this state
condition_typeenumNodate_offset, field_compare, custom_class
condition_configjsonNoCondition parameters (e.g. {"field": "created_at", "offset": 3, "unit": "days"})
action_typeenumNonotification, transition, side_effect
action_configjsonNoAction parameters (e.g. {"notification_id": 5})
frequencyenumNoevery_minute, every_five_minutes, hourly, daily, weekly (default: daily)
once_per_recordbooleanNoExecute at most once per record (default: false)
is_activebooleanNoWhether this check is active (default: true)
last_checked_attimestampYesLast time the scheduler ran this check
created_attimestampYes
updated_attimestampYes

workflow_scheduled_check_logs

Execution log for each scheduled check run against a specific model record.

ColumnTypeNullableDescription
idbigint unsignedNoPrimary key
check_idbigint unsignedNoForeign key to workflow_scheduled_checks
model_typevarchar(100)NoModel class
model_idbigint unsignedNoModel ID
resultenumNotriggered, skipped, already_executed, error
metadatajsonYesAdditional context about the execution
executed_attimestampNoWhen the check ran (default: current time)

Proprietary software. All rights reserved.