- Notifications
You must be signed in to change notification settings - Fork1
PHP SDK for Serverless Workflow
License
NotificationsYou must be signed in to change notification settings
serverlessworkflow/sdk-php
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Provides the PHP API/SPI for theServerless Workflow Specification.
With the SDK you can:
- Programmatically build workflow definitions
- Parse workflow JSON and YAML definitions
- Validate workflow definitions
Current SDK version conforms to theServerless Workflow specification v0.8.
composer install serverlessworkflow/sdk
useServerless\Workflow\Action;useServerless\Workflow\ActionDataFilter;useServerless\Workflow\FunctionDef;useServerless\Workflow\FunctionRef;useServerless\Workflow\OperationState;useServerless\Workflow\Workflow;$workflow =newWorkflow(['id' =>'greeting','name' =>'Greeting Workflow','description' =>'Greet Someone','version' =>'1.0','specVersion' =>'0.8','start' =>'Greet','states' => [newOperationState(['name' =>'Greet','type' =>'operation','actions' => [newAction(['functionRef' =>newFunctionRef(['refName' =>'greetingFunction','arguments' => ['name' =>'${ .person.name }', ], ]),'actionDataFilter' =>newActionDataFilter(['results' =>'${ .greeting }', ]), ]), ],'end' =>true, ]), ],'functions' => [newFunctionDef(['name' =>'greetingFunction','operation' =>'file://myapis/greetingapis.json#greeting', ]), ],]);
$workflow = Workflow::fromJson(file_get_contents('workflow.json'));$workflow = Workflow::fromYaml(file_get_contents('workflow.yaml'));
$json =$workflow->toJson();$yaml =$workflow->toYaml();
useServerless\Workflow\WorkflowValidator;WorkflowValidator::validate($workflow);
Thevalidate
method will raise an exception if the provided workflow does not comply with the specification.
About
PHP SDK for Serverless Workflow
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.