PHP code example of juststeveking / workflow

1. Go to this page and download the library: Download juststeveking/workflow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

juststeveking / workflow example snippets


use JustSteveKing\Workflow\WorkflowRunner;

$runner = WorkflowRunner::build();

use JustSteveKing\Workflow\WorkflowRunner;

$runner = WorkflowRunner::build(
    workflows: [
        WorkflowBuilder::make(
            payload: JsonLoader::load(__DIR__ . '/path/to/workflow.json')
        )
    ]
);

use JustSteveKing\Workflow\WorkflowBuilder;
use JustSteveKing\Workflow\Loaders\JsonLoader;

$workflow = WorkflowBuilder::make(
    payload: JsonLoader::load(__DIR__ . '/path/to/workflow.json')
);

use JustSteveKing\Workflow\WorkflowBuilder;
use JustSteveKing\Workflow\Loaders\YamlLoader;

$workflow = WorkflowBuilder::make(
    payload: YamlLoader::load(__DIR__ . '/path/to/workflow.yaml')
);

use JustSteveKing\Workflow\WorkflowRunner;

$runner = WorkflowRunner::build(
    workflows: [
        WorkflowBuilder::make(
            payload: JsonLoader::load(__DIR__ . '/path/to/workflow.json')
        )
    ]
);

$runner->run();

$runner->logs();