Skip to content

API Reference ​

Components ​

ComponentNamespaceDescription
StateSelectRoBYCoNTe\FilamentFlow\Forms\ComponentsDropdown select for states
StateRadioRoBYCoNTe\FilamentFlow\Forms\ComponentsRadio button group for states
StateToggleButtonsRoBYCoNTe\FilamentFlow\Forms\ComponentsToggle button group for states
StateSelectColumnRoBYCoNTe\FilamentFlow\Tables\ColumnsInteractive table column (with sorting)
StateColumnRoBYCoNTe\FilamentFlow\Tables\ColumnsDisplay-only table column (with sorting)
StateExportColumnRoBYCoNTe\FilamentFlow\Tables\ColumnsExport column with state label formatting
StateSelectFilterRoBYCoNTe\FilamentFlow\Tables\FiltersTable filter for states
StateGroupRoBYCoNTe\FilamentFlow\Tables\GroupingGroup table records by state

Infolist components ​

ComponentNamespaceDescription
AssignmentSummaryEntryRoBYCoNTe\FilamentFlow\Infolists\ComponentsWho holds the record, with the kind of each assignment
StateBadgeRoBYCoNTe\FilamentFlow\Infolists\ComponentsThe label, colour and icon of the state of a record
TransitionTimelineRoBYCoNTe\FilamentFlow\Infolists\ComponentsWhen the record moved, from which state to which, and by whom

The three read the workflow, so they need the tenant of the record: without it a workflow scoped to an owner is not found, and they draw themselves empty.

Actions ​

ActionNamespaceDescription
StateActionRoBYCoNTe\FilamentFlow\ActionsSingle record state transition
StateActionGroupRoBYCoNTe\FilamentFlow\ActionsAuto-generated action group
StateBulkActionRoBYCoNTe\FilamentFlow\ActionsBulk state transition
StateBulkActionGroupRoBYCoNTe\FilamentFlow\ActionsThe bulk actions of a table, one per transition

Utilities ​

UtilityNamespaceDescription
StateTabsRoBYCoNTe\FilamentFlowTabs that group the records by state, with a badge and a query each
FilamentFlowRoBYCoNTe\FilamentFlowThe entry point of the package: the workflow of a model, and the services, resolved by name

Interfaces ​

InterfaceMethodsDescription
HasLabelgetLabel(): stringDisplay name for the state — Filament's Filament\Support\Contracts\HasLabel
HasIcongetIcon(): stringIcon for the state — Filament\Support\Contracts\HasIcon
HasColorgetColor(): string|arrayColour for the state — Filament\Support\Contracts\HasColor
HasDescriptiongetDescription(): stringDescription of the state — Filament\Support\Contracts\HasDescription
HasStateMetadataCombines all metadata interfacesFull state metadata contract
HasStateSortOrdergetSortOrder(): intCustom sort position for state
HasAccessRulesgetCreateAccessRules(), getViewAccessRules(), getEditAccessRules(), getTransitionAccessRules()Code-First state access rules
RoleResolvergetRoles(), hasAnyRole(), isSuperAdmin()Role resolution for access control
PermissionResolverhasPermission()Permission resolution for access control
HasStateNotificationsonEnterNotifications(), onExitNotifications()Notifications on state enter/exit
HasTransitionNotificationsnotifications()Notifications on transition
HasStateActionwithTransitionClass(), getTransitionClass()A class that is a state action: the state it works on, the transition it runs
HasStateAttributesgetAttribute(), attribute()Whatever carries a state attribute: which column holds it
HasFieldLabelsgetFieldLabels()Labels a host gives to the fields of a transition
FieldListProviderInterfacegetFields(): arrayWhich fields a formula may name, for a context
FormulaCompletionProvidergetCompletions(): CompletionPayloadThe variables and functions of one formula scope
FormulaConditionProvider—Evaluates the formulas of a condition for the host

Traits ​

TraitNamespaceDescription
HasStateMetadataRoBYCoNTe\FilamentFlow\ConcernsProvides metadata methods for states
HasStateSortOrderRoBYCoNTe\FilamentFlow\ConcernsProvides sort order mapping for states
HasStateSortingRoBYCoNTe\FilamentFlow\ConcernsEnables custom sorting in table columns
HasStateOptionsRoBYCoNTe\FilamentFlow\ConcernsProvides state options for form/table fields
HasDatabaseTransitionsRoBYCoNTe\FilamentFlow\ConcernsEnables database-configured transitions
HasFlexibleStatesRoBYCoNTe\FilamentFlow\ConcernsSupports both PHP and database-only states
HasStateAccessRoBYCoNTe\FilamentFlow\ConcernsEnables state-based access control for models
HasStateActionsRoBYCoNTe\FilamentFlow\ConcernsCommon functionality for state actions
HasStateAttributesRoBYCoNTe\FilamentFlow\ConcernsManages state attribute mapping
HasTransitionFormRoBYCoNTe\FilamentFlow\ConcernsHandles transition form generation and validation
HasWorkflowCreationRoBYCoNTe\FilamentFlow\ConcernsDatabase workflow creation helpers
HasWorkflowAssignmentsRoBYCoNTe\FilamentFlow\ConcernsWorkflow assignment management
HasWorkflowFormRoBYCoNTe\FilamentFlow\ConcernsForm building for workflow configuration
ResolvesActionAttributesRoBYCoNTe\FilamentFlow\ConcernsResolves state attributes for actions
ChecksTransitionGuardsRoBYCoNTe\FilamentFlow\ConcernsThe guards and the conditions of a transition
ChecksTransitionPermissionsRoBYCoNTe\FilamentFlow\ConcernsWho may take a transition
LogsTransitionHistoryRoBYCoNTe\FilamentFlow\ConcernsThe history of the transitions of a record
ParsesStateCastRoBYCoNTe\FilamentFlow\ConcernsReading the state out of the model's cast
ResolvesUserModelRoBYCoNTe\FilamentFlow\ConcernsWhich model is the user of this application
ResolvesWorkflowActionsRoBYCoNTe\FilamentFlow\ConcernsThe actions a record offers
ResolvesWorkflowStatesRoBYCoNTe\FilamentFlow\ConcernsThe states of a record
TriggersTransitionNotificationsRoBYCoNTe\FilamentFlow\ConcernsNotifications raised by a transition
HasRelationManagerFormRoBYCoNTe\FilamentFlow\ConcernsThe form of a relation manager
HasWorkflowTableRoBYCoNTe\FilamentFlow\ConcernsThe table of a workflow resource

Models (Database-Driven Workflows) ​

ModelNamespaceDescription
WorkflowRoBYCoNTe\FilamentFlow\ModelsWorkflow definitions
WorkflowStateRoBYCoNTe\FilamentFlow\ModelsState definitions (PHP or database-only)
WorkflowTransitionRoBYCoNTe\FilamentFlow\ModelsTransition configurations
WorkflowTransitionFieldRoBYCoNTe\FilamentFlow\ModelsFields to show in transition forms
WorkflowStateFieldRoBYCoNTe\FilamentFlow\ModelsField permissions per state
WorkflowStateFieldRoleRoBYCoNTe\FilamentFlow\ModelsWhat a role may do on a field of a state
WorkflowStateVisibilityRoBYCoNTe\FilamentFlow\ModelsA visibility rule of a state
WorkflowAssignmentRoBYCoNTe\FilamentFlow\ModelsUser/team assignments to workflows
WorkflowOwnerChangeRoBYCoNTe\FilamentFlow\ModelsThe handovers of a record: who held it, who holds it now, what the previous holder kept
WorkflowNotificationRoBYCoNTe\FilamentFlow\ModelsNotification configurations
WorkflowNotificationRecipientRoBYCoNTe\FilamentFlow\ModelsNotification recipient strategies
WorkflowNotificationChannelRoBYCoNTe\FilamentFlow\ModelsNotification delivery channels
WorkflowNotificationTemplateRoBYCoNTe\FilamentFlow\ModelsNotification message templates
WorkflowNotificationLogRoBYCoNTe\FilamentFlow\ModelsNotification delivery audit logs
WorkflowUserInvolvementRoBYCoNTe\FilamentFlow\ModelsUser involvement tracking
WorkflowTransitionSnapshotRoBYCoNTe\FilamentFlow\ModelsAudit trail for transitions
WorkflowStateTransitionRoBYCoNTe\FilamentFlow\ModelsThe transitions a state takes part in
WorkflowTransitionPermissionRoBYCoNTe\FilamentFlow\ModelsWho may take a transition
WorkflowTransitionSideEffectRoBYCoNTe\FilamentFlow\ModelsWhat a transition writes when it runs
WorkflowTransitionValidationRuleRoBYCoNTe\FilamentFlow\ModelsThe rules a transition applies, and the fields its dialog asks for
WorkflowScheduledCheckRoBYCoNTe\FilamentFlow\ModelsA check the engine runs on a schedule
WorkflowScheduledCheckLogRoBYCoNTe\FilamentFlow\ModelsWhen a scheduled check last ran, and what it did
WorkflowTransitionMetadataRoBYCoNTe\FilamentFlow\ModelsAdditional metadata for transitions
WorkflowStateAccessRuleRoBYCoNTe\FilamentFlow\ModelsState-based access control rules

Services ​

ServiceNamespaceDescription
StateServiceRoBYCoNTe\FilamentFlow\ServicesManages state metadata and options
TransitionFormServiceRoBYCoNTe\FilamentFlow\ServicesBuilds and validates transition forms
WorkflowCreationServiceRoBYCoNTe\FilamentFlow\ServicesCreates workflows from configuration
WorkflowFieldPermissionsServiceRoBYCoNTe\FilamentFlow\ServicesManages field permissions
WorkflowStateAccessServiceRoBYCoNTe\FilamentFlow\ServicesState-based access control evaluation
NotificationServiceRoBYCoNTe\FilamentFlow\ServicesOrchestrates workflow notifications
RecipientResolverRoBYCoNTe\FilamentFlow\ServicesResolves notification recipients
FormBuilderHelperRoBYCoNTe\FilamentFlow\ServicesAdvanced form building utilities
ConditionEvaluatorRoBYCoNTe\FilamentFlow\ServicesThe conditions of a transition, evaluated against a record
ScheduledCheckRunnerRoBYCoNTe\FilamentFlow\ServicesThe engine of the scheduled checks
SideEffectExecutorRoBYCoNTe\FilamentFlow\ServicesThe effects a transition writes
WorkflowValidationServiceRoBYCoNTe\FilamentFlow\ServicesValidating a transition and the values it is given
EvaluatesAccessRulesRoBYCoNTe\FilamentFlow\ServicesReading the access rules of a state
ScopesAccessibleRecordsRoBYCoNTe\FilamentFlow\ServicesNarrowing a query to what a user may see
ReadsFieldPermissionsRoBYCoNTe\FilamentFlow\ServicesWhat a state allows on each field
ReadsCreationAndColumnPermissionsRoBYCoNTe\FilamentFlow\ServicesThe permissions of creating a record, and of the columns of a list
ResolvesFieldPermissionContextRoBYCoNTe\FilamentFlow\ServicesThe state, the user and the tenant a permission is read for
AppliesValidationRulesRoBYCoNTe\FilamentFlow\ServicesApplying the rules of a transition to the values
EvaluatesValidationValuesRoBYCoNTe\FilamentFlow\ServicesEvaluating a value against the rules of its field
ResolvesValidationContextRoBYCoNTe\FilamentFlow\ServicesThe context a rule is evaluated in
FindsNotificationTargetsRoBYCoNTe\FilamentFlow\ServicesWho a notification reaches
DeliversNotificationsRoBYCoNTe\FilamentFlow\ServicesSending a notification through its channels

Casts ​

CastNamespaceDescription
FlexibleStateCastRoBYCoNTe\FilamentFlow\CastsCustom cast for PHP + database-only states

Jobs and validation ​

ClassNamespaceDescription
SendWorkflowNotificationRoBYCoNTe\FilamentFlow\JobsThe queued job that sends one notification
ValidationResultRoBYCoNTe\FilamentFlow\ValidationWhat a validation pass found: the problems, with the field each one belongs to
ValidationLevelRoBYCoNTe\FilamentFlow\Definition\EnumsHow much a transition validates: nothing, the fields, or everything

Support Classes ​

ClassNamespaceDescription
DefaultRoleResolverRoBYCoNTe\FilamentFlow\SupportDefault role resolver (supports Spatie Permission)
DefaultPermissionResolverRoBYCoNTe\FilamentFlow\SupportDefault permission resolver (supports Gates)
AccessRuleEvaluatorRoBYCoNTe\FilamentFlow\SupportEvaluates access rule tokens against users/records
AccessibleStatesRoBYCoNTe\FilamentFlow\SupportThe states a user may see, and what it means when there are none
CanonicalJsonRoBYCoNTe\FilamentFlow\SupportThe canonical form of a value: the order of the keys does not count, the order of a list does
CompletionPayloadRoBYCoNTe\FilamentFlow\SupportThe variables and functions of a formula scope, as the editor reads them
FormulaCompletionRegistryRoBYCoNTe\FilamentFlow\SupportThe scopes of the formula editor, registered by name
FormulaConditionRegistryRoBYCoNTe\FilamentFlow\SupportThe hosts able to evaluate a formula condition
WorkflowFormulaScopeRoBYCoNTe\FilamentFlow\SupportThe workflow scope of the formula editor
ModelDiscoveryRoBYCoNTe\FilamentFlow\SupportReading the columns of a model
FieldPermissionApplierRoBYCoNTe\FilamentFlow\SupportApplying the permissions of a state to a component
ComponentIdentifierRoBYCoNTe\FilamentFlow\SupportThe name a component was made with
RuleOptionsRoBYCoNTe\FilamentFlow\SupportThe access-rule tokens and relationships offered where they make sense
UserModelRoBYCoNTe\FilamentFlow\SupportWhich class is the user of the application
AssignmentTypeConfigRoBYCoNTe\FilamentFlow\SupportThe kinds of assignment, with their labels
FieldChangesRoBYCoNTe\FilamentFlow\SupportThe delta of two sets of values: the paths that moved, compared as a person would (5000 and 5000.00 are the same value)
LocalizedDateRoBYCoNTe\FilamentFlow\SupportHow a date reads when nobody chose: the day before the month where the language belongs
RoleLabelRoBYCoNTe\FilamentFlow\SupportThe words a role reads in: the labels of the host, then the translations, then the name as it is written

Presentation ​

How a field reads in the history: the words of the host, the shape of a value, and the generic reading the engine falls back to.

ClassNamespaceDescription
FieldFormatRoBYCoNTe\FilamentFlow\PresentationHow a presented value reads: a line of text, labelled pairs, a table, a set of files — or nothing
FieldPresentationRoBYCoNTe\FilamentFlow\PresentationA field as a person should read it: its label, the shape of its value, the block it belongs to, whether it belongs to the history
DefaultFieldPresenterRoBYCoNTe\FilamentFlow\PresentationHow a value reads when nobody claimed it: a map becomes labelled pairs, a list of maps a table, a boolean yes or no

Exceptions ​

All exceptions live in the RoBYCoNTe\FilamentFlow\Exceptions namespace.

ExceptionWhen ThrownNotable Properties / Methods
UnauthorizedTransitionExceptionUser not allowed to transition to a stategetRecord(), getFromState(), getToState(), getUser()
WorkflowNotFoundExceptionNo active workflow found for the model class$modelClass property
ActionNotFoundExceptionRequested action does not exist for the current state$actionName property
ConditionNotMetExceptionA transition condition evaluated to false$actionName property
InitialStateNotFoundExceptionWorkflow exists but has no state marked as initial—
AuthenticationRequiredExceptionAn operation requires an authenticated user but none is present—
StateDeletionExceptionCannot delete a state because transitions reference it—
InvalidStateExceptionThe state field value is not a valid State instance—
InvalidComponentExceptionA Filament form component does not support readonly/disabled$fieldName property
UnknownValidationRuleExceptionA declaration names a validation rule nobody registered$ruleName property
FormulaConditionFailedExceptionA formula condition refused, with the message the host gave itgetMessage()

UnauthorizedTransitionException exposes:

  • getMessage() — Human-readable error message
  • getRecord() — The model record involved
  • getFromState() — The source state class/name
  • getToState() — The target state class/name
  • getUser() — The user who attempted the transition (null if unauthenticated)

Builders ​

BuilderNamespaceDescription
WorkflowNotificationBuilderRoBYCoNTe\FilamentFlow\BuildersFluent builder for code-first notifications

WorkflowNotificationBuilder Methods:

php
WorkflowNotificationBuilder::make()
    ->name('notification_name')           // Optional name for logging
    ->channel('database', $config)        // Channel: database, mail
    ->recipients(['@owner', 'role:admin']) // Who receives the notification
    ->title('Title with {{variables}}')    // Notification title
    ->body('Body with {{variables}}')      // Notification body
    ->subject('Email subject')             // Email subject (mail channel)
    ->actionUrl('/url', 'Button Text')     // Action button
    ->priority('high')                     // low, medium, high, urgent
    ->templateEngine('plain')              // plain, blade, mustache
    ->immediate()                          // Send immediately (default)
    ->delay(30)                            // Delay by minutes
    ->metadata(['key' => 'value']);        // Additional metadata

Advanced Features ​

Custom State Sorting ​

Define custom sort order for states in tables to match your workflow logic:

php
// In your state classes
class PendingState extends OrderState implements HasStateSortOrder
{
    public static function getSortOrder(): int
    {
        return 1; // First in the list
    }
}

class ProcessingState extends OrderState implements HasStateSortOrder
{
    public static function getSortOrder(): int
    {
        return 2; // Second in the list
    }
}

Then use sortable columns:

php
StateSelectColumn::make('state')
    ->sortable() // Uses custom sort order automatically

Workflow Model Scopes ​

RoBYCoNTe\FilamentFlow\Models\Workflow

Static Finder ​

php
use RoBYCoNTe\FilamentFlow\Models\Workflow;

// Find the active workflow for a model class (tenant fallback applied automatically)
Workflow::findForModel(Order::class, 'state');

// Find for a specific tenant ID (overrides auto-detection)
Workflow::findForModel(Order::class, 'state', $tenantId);

findForModel checks for a tenant-specific workflow first, then falls back to a global workflow (tenant_id = null). Results are cached using the configured cache store and TTL.

Query Scopes ​

php
// Include both global and current-tenant workflows
Workflow::query()->forCurrentTenant()->get();

// Only workflows for a specific tenant
Workflow::query()->forTenant($tenantId)->get();

// Only global workflows (tenant_id = null)
Workflow::query()->global()->get();

Instance Methods ​

php
$workflow->initialState();    // ?WorkflowState — the state marked is_initial = true
$workflow->finalStates();     // HasMany<WorkflowState> — states marked is_final = true
$workflow->isGlobal();        // bool — true when tenant_id is null
$workflow->isTenantSpecific(); // bool — true when tenant_id is set

// Flush all workflow caches (affects entire cache store — use with care)
Workflow::flushCache();

Workflow Definition SDK ​

ClassNamespaceDescription
WorkflowDefinitionRoBYCoNTe\FilamentFlow\DefinitionTyped workflow definition (states, transitions, metadata)
StateRoBYCoNTe\FilamentFlow\DefinitionA workflow state (initial/final, color, per-state fields)
StateFieldRoBYCoNTe\FilamentFlow\DefinitionPer-state field visibility/mutability/required
TransitionRoBYCoNTe\FilamentFlow\DefinitionState transition or in-state action (guards, effects, rules)
SideEffectRoBYCoNTe\FilamentFlow\DefinitionTransition side effect
ValidationRuleRoBYCoNTe\FilamentFlow\DefinitionTransition validation rule
ScheduledCheckRoBYCoNTe\FilamentFlow\DefinitionTyped scheduled check (condition, frequency, action)
AccessRuleRoBYCoNTe\FilamentFlow\DefinitionState access rule (view/edit/transition/create)
NotificationRoBYCoNTe\FilamentFlow\DefinitionNotification (trigger, channels, template)
RecipientRoBYCoNTe\FilamentFlow\DefinitionTyped notification recipient

Enums ​

EnumValues
Visibilityvisible, hidden
Mutabilityreadonly, editable, locked
SideEffectTypeset_field, set_timestamp, clear_field, increment, custom_class, create_child_application
ScheduledCheckConditiondate_offset, field_compare, custom_class
ScheduledCheckActionnotification, transition, side_effect
ScheduledCheckFrequencyevery_minute, every_five_minutes, hourly, daily, weekly
AccessTypeview, edit, transition, create
AccessOperatoror, and
NotificationTriggeron_transition, on_state_enter, on_state_exit, on_assignment, on_field_change
NotificationTimingimmediate, delayed
NotificationPrioritylow, medium, high, urgent
NotificationChanneldatabase, mail
RecipientTyperole, user, trigger_user, assigned_users, record_owner, state_actors, all_involved, involvement_type, custom_field, custom_query, custom_class

Proprietary software. All rights reserved.