This is a sample Laravel 12 application with example workflows that you can run inside a GitHub codespace.
Create a codespace from the main branch of this repo.
Once the codespace has been created, wait for the codespace to build. This should take between 5 to 10 minutes.
Once it is done. You will see the editor and the terminal at the bottom.
Run the init command to setup the app, install extra dependencies and run the migrations.
php artisan app:initStart the queue worker. This will enable the processing of workflows and activities.
php artisan queue:workCreate a new terminal window.
Start the example workflow inside the new terminal window.
php artisan app:workflowYou can view the waterline dashboard at https://[your-codespace-name]-80.preview.app.github.dev/waterline/dashboard.
Run the workflow and activity tests.
php artisan testThat's it! You can now create and test workflows.
In addition to the basic example workflow, you can try these other workflows included in this sample app:
-
php artisan app:elapsed– Demonstrates how to correctly track start and end times to measure execution duration. -
php artisan app:microservice– A fully working example of a workflow that spans multiple Laravel applications using a shared database and queue. -
php artisan app:playwright– Runs a Playwright automation, captures a WebM video, encodes it to MP4 using FFmpeg, and then cleans up the WebM file. -
php artisan app:webhook– Showcases how to use the built-in webhook system for triggering workflows externally. -
php artisan app:prism- NEW! Uses PrismPHP + Laravel Workflow to build a durable AI agent loop. It asks an LLM to generate user profiles and hobbies, validates the result, and retries until the data meets business rules.
Try them out to see Laravel Workflow in action across different use cases!
This sample app includes an MCP (Model Context Protocol) server that allows AI clients (ChatGPT, Claude, Cursor, etc.) to start and monitor Laravel Workflows.
The MCP server is available at: /mcp/workflows
| Tool | Description |
|---|---|
list_workflows |
Discover available workflows and view recent workflow runs |
start_workflow |
Start a workflow asynchronously and get a workflow ID |
get_workflow_result |
Check workflow status and retrieve output when completed |
Available workflows are defined in config/workflow_mcp.php. By default, the following workflows are exposed:
simple→App\Workflows\Simple\SimpleWorkflowprism→App\Workflows\Prism\PrismWorkflow
To add more workflows, update the config file:
'workflows' => [
'simple' => App\Workflows\Simple\SimpleWorkflow::class,
'prism' => App\Workflows\Prism\PrismWorkflow::class,
'my_workflow' => App\Workflows\MyWorkflow::class,
],An AI client would typically:
- Call
list_workflowsto see available workflows - Call
start_workflowwith{"workflow": "simple"} - Receive a
workflow_idin the response - Poll
get_workflow_resultwith theworkflow_iduntil status isWorkflowCompletedStatus - Read the
outputfield for the workflow result



