Skip to content

Artisan Commands

Workflowable provides several Artisan commands for managing workflows from the CLI.

workflowable:list

List all workflow definitions.

bash
php artisan workflowable:list
php artisan workflowable:list --active
php artisan workflowable:list --inactive

Displays a table with ID, name, version, active status, step count, instance count, and creation date.

workflowable:status

Show workflow instance details or list instances.

bash
# Show a specific instance
php artisan workflowable:status 42

# List instances with filters
php artisan workflowable:status --status=failed
php artisan workflowable:status --workflow=order_approval
php artisan workflowable:status --limit=20

workflowable:retry

Retry a failed workflow instance from its current step.

bash
php artisan workflowable:retry 42

workflowable:schedule

Evaluate CRON-based workflow schedules and dispatch any that are due.

bash
php artisan workflowable:schedule

Typically registered in your scheduler to run every minute:

php
Schedule::command('workflowable:schedule')->everyMinute();

workflowable:verify

Verify state integrity of workflow instances by replaying stored events.

bash
php artisan workflowable:verify

workflowable:versions

List all versions of a workflow definition.

bash
php artisan workflowable:versions order_approval

Displays version number, active status, step count, instance count, creation date, and created by.

make:workflow-action

Scaffold a new workflow action handler class.

bash
php artisan make:workflow-action ProcessOrder

Creates app/Workflows/Actions/ProcessOrder.php with a handle(ExecutionContext $context): array method.

make:workflow-conditional

Scaffold a new workflow conditional handler class.

bash
php artisan make:workflow-conditional IsHighValue

Creates app/Workflows/Conditionals/IsHighValue.php implementing the Conditional interface with an evaluate(ExecutionContext $context): bool method.

make:workflow-event

Scaffold a new workflow event DTO class.

bash
php artisan make:workflow-event OrderSubmitted

Creates app/Workflows/Events/OrderSubmitted.php extending WorkflowEvent with an empty constructor ready for your typed properties.