8000 GitHub - Javaabu/workflows: Dynamic workflow builder: workflows defined fluently and seeded, or built visually by drag and drop, with developer-defined actions, conditionals, form-builder data, a workflow tester and an optional AI assistant · GitHub
[go: up one dir, main page]

Skip to content
JavaabuPublic

About

Dynamic workflow builder: workflows defined fluently and seeded, or built visually by drag and drop, with developer-defined actions, conditionals, form-builder data, a workflow tester and an optional AI assistant

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workflows

Tests codecov Latest Version on Packagist License: MIT

Dynamic workflows for Laravel: leave requests, purchase approvals, applications, anything that goes through steps where people decide what happens next.

  • Definitions with steps (start, task, decision, action, end), transitions, assignees and conditions, versioned: instances stay on the version they started with.
  • Instances with tasks, an inbox per user, a full history and events.
  • Fluent definitions for seeders, idempotent and lockable to code.
  • A visual builder: drag, connect and edit steps, all by keyboard too, in Inertia React and Blade.
  • Actions: notify (javaabu/notifications), update the record, call a webhook, set data, or your own.
  • Step data with javaabu/form-builder forms.
  • A tester that shows the path a run takes with sample data, and an optional laravel/ai assistant that designs workflows.
  • Permissions through javaabu/permissions for any guard and user model. Optional javaabu/translatable. Dhivehi and RTL.
use Javaabu\Workflows\Definitions\Assignee;
use Javaabu\Workflows\Definitions\Step;
use Javaabu\Workflows\Definitions\Transition;
use Javaabu\Workflows\Facades\Workflows;

Workflows::define('leave-request')
    ->name(['en' => 'Leave request', 'dv' => 'ޗުއްޓީގެ އެދުން'])
    ->for(LeaveRequest::class)
    ->steps([
        Step::start()->form('leave-request'),
        Step::task('review')->assignTo(Assignee::subject('manager'))->runs('notify', ['to' => [['type' => 'assignees']], 'title' => 'A leave request to review']),
        Step::end('approved')->runs('update_model', ['attributes' => ['status' => 'approved']]),
        Step::end('rejected'),
    ])
    ->transitions([
        Transition::make('submit')->from('start')->to('review'),
        Transition::make('approve')->from('review')->to('approved')->label('Approve')->color('success'),
        Transition::make('reject')->from('review')->to('rejected')->label('Reject')->color('danger')->requireComment()->skipForm(),
    ])
    ->sync();

// routes/web.php
Route::workflows(['guard' => 'web_admin', 'prefix' => 'admin/workflows', 'name' => 'admin.workflows']);
Route::workflowTasks();   // /tasks

// anywhere
$instance = $leave->startWorkflow('leave-request', by: $request->user(), data: $request);
$instance->transition('approve', by: $manager, comment: 'ރަނގަޅު');

Documentation

The docs are in docs/, indexed for assistants in llms.txt.

Testing

composer test
pnpm test

Changelog

See CHANGELOG.

Contributing

See CONTRIBUTING.

Security

If you discover a security issue, email info@javaabu.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). See License File for more information.

About

Dynamic workflow builder: workflows defined fluently and seeded, or built visually by drag and drop, with developer-defined actions, conditionals, form-builder data, a workflow tester and an optional AI assistant

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0